From: <th...@us...> - 2008-12-07 03:24:52
|
Revision: 8587 http://pcgen.svn.sourceforge.net/pcgen/?rev=8587&view=rev Author: thpr Date: 2008-12-07 03:24:47 +0000 (Sun, 07 Dec 2008) Log Message: ----------- remove dead code Modified Paths: -------------- Trunk/pcgen/code/src/java/pcgen/core/BioSet.java Trunk/pcgen/code/src/java/pcgen/core/CampaignURL.java Trunk/pcgen/code/src/java/pcgen/core/Equipment.java Trunk/pcgen/code/src/java/pcgen/core/EquipmentChoice.java Trunk/pcgen/code/src/java/pcgen/core/EquipmentCollection.java Trunk/pcgen/code/src/java/pcgen/core/EquipmentList.java Trunk/pcgen/code/src/java/pcgen/core/GameMode.java Trunk/pcgen/code/src/java/pcgen/core/Globals.java Trunk/pcgen/code/src/java/pcgen/core/Movement.java Trunk/pcgen/code/src/java/pcgen/core/PCClass.java Trunk/pcgen/code/src/java/pcgen/core/PObject.java Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java Trunk/pcgen/code/src/java/pcgen/core/SourceEntry.java Trunk/pcgen/code/src/java/pcgen/core/StatList.java Trunk/pcgen/code/src/java/pcgen/core/character/SpellInfo.java Trunk/pcgen/code/src/java/pcgen/core/prereq/PrereqHandler.java Trunk/pcgen/code/src/java/pcgen/core/prereq/Prerequisite.java Trunk/pcgen/code/src/java/pcgen/core/utils/CoreUtility.java Trunk/pcgen/code/src/java/pcgen/persistence/lst/PCClassLoader.java Trunk/pcgen/code/src/java/pcgen/persistence/lst/prereq/PreParserFactory.java Removed Paths: ------------- Trunk/pcgen/code/src/java/pcgen/core/ChoiceInfo.java Trunk/pcgen/code/src/java/pcgen/core/SpellFilter.java Trunk/pcgen/code/src/java/pcgen/core/Variable.java Trunk/pcgen/code/src/java/pcgen/core/VariableList.java Trunk/pcgen/code/src/java/pcgen/core/analysis/LanguageSupport.java Modified: Trunk/pcgen/code/src/java/pcgen/core/BioSet.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/BioSet.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/BioSet.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -218,21 +218,6 @@ } /** - * Add the supplied line to the race map. The race map contains an array - * with an entry for each age set. The supplied index is used to ensure - * that the value is placed in the correct age bracket. - * - * @param region The region the race is defined in. - * @param race The race to be updated. - * @param tag The tag to be entered. Must be in the form key:value - * @param ageSetIndex The age set to be updated. - */ - public void addToRaceMap(final String region, final String race, final String tag, final int ageSetIndex) - { - addToMap(raceMap, region, race, tag, ageSetIndex); - } - - /** * Add the supplied line to the user map. The user map contains an array with * an entry for each age set. The supplied index is used to ensure that the * value is placed in the correct age bracket. @@ -244,11 +229,6 @@ */ public void addToUserMap(final String region, final String race, final String tag, final int ageSetIndex) { - addToMap(userMap, region, race, tag, ageSetIndex); - } - - private static void addToMap(final Map<String, List<String>> map, final String region, final String race, final String tag, final int ageSetIndex) - { final int x = tag.indexOf(':'); if (x < 0) @@ -260,7 +240,7 @@ final String key = region + "." + race + "." + tag.substring(0, x); final String value = tag.substring(x + 1); - List<String> r = map.get(key); + List<String> r = userMap.get(key); if (r == null) { @@ -273,7 +253,7 @@ } r.set(ageSetIndex, value); - map.put(key, r); + userMap.put(key, r); } /** Modified: Trunk/pcgen/code/src/java/pcgen/core/CampaignURL.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/CampaignURL.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/CampaignURL.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -48,13 +48,13 @@ } /** The kind of url */ - private URLKind urlKind; + private final URLKind urlKind; /** The name of the url (only for ecommerce sites) */ - private String urlName; + private final String urlName; /** The URL itself */ - private URL url; + private final URL url; /** The displayed description of the url */ - private String urlDesc; + private final String urlDesc; /** * Instantiates a new campaign url. @@ -82,14 +82,6 @@ } /** - * @param urlKind the urlKind to set - */ - void setUrlKind(URLKind urlKind) - { - this.urlKind = urlKind; - } - - /** * @return the urlName */ public String getUrlName() @@ -98,14 +90,6 @@ } /** - * @param urlName the urlName to set - */ - void setUrlName(String urlName) - { - this.urlName = urlName; - } - - /** * @return the url */ public URL getUrl() @@ -114,14 +98,6 @@ } /** - * @param url the url to set - */ - void setUrl(URL url) - { - this.url = url; - } - - /** * @return the urlDesc */ public String getUrlDesc() @@ -129,14 +105,6 @@ return urlDesc; } - /** - * @param urlDesc the urlDesc to set - */ - void setUrlDesc(String urlDesc) - { - this.urlDesc = urlDesc; - } - /* (non-Javadoc) * @see java.lang.Comparable#compareTo(java.lang.Object) */ Deleted: Trunk/pcgen/code/src/java/pcgen/core/ChoiceInfo.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/ChoiceInfo.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/ChoiceInfo.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -1,75 +0,0 @@ -/* - * ChoiceInfo.java - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Current Version: $Revision$ - * Last Editor: $Author$ - * Last Edited: $Date: 2006-03-22 22:52:02 +0000 (Wed, 22 Mar 2006) $ - * - * Copyright 2006 Andrew Wilson <nu...@so...> - */ -package pcgen.core; - -/** - * This tiny little class implements a way to associate prerequisites with a - * simple string. This is a subclass of AbilityInfo so we can reuse some of - * its code - * - * @author Andrew Wilson <nu...@so...> - */ -public class ChoiceInfo extends AbilityInfo -{ - - /** - * Make a new object to hold info about a string and some associated - * prerequisites. - * - * @param key the Key of the Ability - * @param delim the Ability's category - */ - public ChoiceInfo(String key, char delim) - { - super(); - - this.category = "NONE"; - - if (delim == '[') { - this.delim = '['; - } - - this.extractPrereqs(key); - } - - public final Ability getAbility() - { - return null; - } - - /** - * Compares this AbilityInfo Object with an Object passed in. The object - * passed in should be either an AbilityInfo Object or a PObject. - * - * @param obj the object to test against - * - * @return the result of the compare, negative integer if this should sort - * before - */ - public int compareTo(Object obj) - { - return this.keyName.compareTo(obj.toString()); - } - -} Modified: Trunk/pcgen/code/src/java/pcgen/core/Equipment.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/Equipment.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/Equipment.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -2712,20 +2712,6 @@ } /** - * Clears all child types - */ - public void clearChildTypes() { - d_childTypes.clear(); - } - - /** - * Removes all items from this container. - */ - public void clearContainedEquipment() { - d_containedEquipment.clear(); - } - - /** * Description of the Method * * @return Description of the Return Value @@ -2802,17 +2788,6 @@ } /** - * contains - * - * @param e The equipmet to check for - * - * @return true if containedEquipment contains the passed item - */ - public boolean containsContainedEquipment(final Equipment e) { - return d_containedEquipment.contains(e); - } - - /** * DR for equipment * * @param aPC The PC thta has the Equipment @@ -3261,18 +3236,6 @@ } /** - * Removes a child from the Equipment - * - * @param aPC - * The PC carrying the item - * @param childIndex - * The number of the child to remove - */ - public void removeChild(final PlayerCharacter aPC, final int childIndex) { - removeChild(aPC, getChild(childIndex)); - } - - /** * Description of the Method * * @param eqMod @@ -3649,10 +3612,6 @@ return aType.toString(); } - boolean equalTo(final Object o) { - return super.equals(o); - } - boolean save(final BufferedWriter output) { FileAccess.write(output, "BASEITEM:" + formatSaveLine('\t', ':')); FileAccess.newLine(output); @@ -4079,24 +4038,6 @@ } /** - * Checks whether the proposed type is one that is accepted - * - * @param aString - * Description of the Parameter - * @return The acceptsTypes value - */ - private boolean acceptsType(final String aString) { - for (Capacity cap : getSafeListFor(ListKey.CAPACITY)) - { - if (cap.getType().equalsIgnoreCase(aString)) - { - return true; - } - } - return false; - } - - /** * Add a piece of Equipement * * @param e the Equipement to add Modified: Trunk/pcgen/code/src/java/pcgen/core/EquipmentChoice.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/EquipmentChoice.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/EquipmentChoice.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -57,6 +57,9 @@ private int maxValue = 0; private int incValue = 1; private int maxSelect = 0; + /* + * CONSIDER This is never read, which is probably a bug - thpr Dec 6, 2008 + */ private int pool = 0; private String title = null; Modified: Trunk/pcgen/code/src/java/pcgen/core/EquipmentCollection.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/EquipmentCollection.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/EquipmentCollection.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -74,11 +74,4 @@ * @param child */ void insertChild(PlayerCharacter aPC, Object child); - - /** - * Remove the i'th child. - * @param aPC - * @param i - */ - void removeChild(PlayerCharacter aPC, int i); } Modified: Trunk/pcgen/code/src/java/pcgen/core/EquipmentList.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/EquipmentList.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/EquipmentList.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -323,25 +323,6 @@ } /** - * Return an equipment object from the passed-in list matching the passed-in - * name. - * - * @param name - * the name to match - * @param aList - * the list to search in - * @return the Equipment object matching the name - */ - public static Equipment getEquipmentNamed(final String name, final List<Equipment> aList) { - for ( Equipment eq : aList ) - { - if (eq.getName().equalsIgnoreCase(name)) { return eq; } - } - - return null; - } - - /** * Get an Equipment object from the list matching the passed-in type(s). * * @param eqIterator @@ -584,23 +565,6 @@ } } - static EquipmentModifier getQualifiedModifierNamed(final String aName, final List<String> aType) { - for (EquipmentModifier aEqMod : Globals.getContext().ref.getConstructedCDOMObjects(EquipmentModifier.class)) - { - if (aEqMod.getDisplayName().equals(aName)) { - if (aEqMod.isType("All")) { return aEqMod; } - - for (Iterator<String> e2 = aType.iterator(); e2.hasNext();) { - final String t = e2.next(); - - if (aEqMod.isType(t)) { return aEqMod; } - } - } - } - - return null; - } - private static EquipmentModifier getModifierNamed(final String aName) { for (EquipmentModifier eqMod : Globals.getContext().ref.getConstructedCDOMObjects(EquipmentModifier.class)) { Modified: Trunk/pcgen/code/src/java/pcgen/core/GameMode.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/GameMode.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/GameMode.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -75,7 +75,6 @@ private Map<String, Map<String, LevelInfo>> levelInfo = new HashMap<String, Map<String, LevelInfo>>(); private List<String> loadStrings = new ArrayList<String>(); private List<String> skillMultiplierLevels = new ArrayList<String>(); - private List<String> wcStepsList = new ArrayList<String>(); private List<WieldCategory> wieldCategoryList = new ArrayList<WieldCategory>(); private Map<String, List<String>> ACTypeAddMap = new HashMap<String, List<String>>(); private Map<String, List<String>> ACTypeRemoveMap = new HashMap<String, List<String>>(); @@ -1321,23 +1320,6 @@ wieldCategoryList.add(wCat); } - /** - * The "steps" up or down in the Wield Category chain - * @param aLine - **/ - public void addWieldCategorySteps(final String aLine) - { - wcStepsList.clear(); - - final StringTokenizer aTok = new StringTokenizer(aLine, "|"); - - while (aTok.hasMoreTokens()) - { - final String aName = aTok.nextToken(); - wcStepsList.add(aName); - } - } - public int compareTo(final Object obj) { if (obj != null) @@ -2079,17 +2061,6 @@ } /** - * Add to the bonus spell map - * @param level - * @param baseStatScore - * @param statRange - */ - public void addToBonusSpellMap(final String level, final String baseStatScore, final String statRange) - { - bonusSpellMap.put(level, baseStatScore + '|' + statRange); - } - - /** * Get the bonus spell map * @return the bonus spell map */ @@ -2954,16 +2925,6 @@ /** */ - public void setSkillTabColumnVisible(final int columnIndex, final boolean bVisible) - { - if ((columnIndex >= 0) && (columnIndex < skillTabColumnVisible.length)) - { - skillTabColumnVisible[columnIndex] = bVisible; - } - } - - /** - */ public boolean getSkillTabColumnVisible(final int columnIndex) { if ((columnIndex >= 0) && (columnIndex < skillTabColumnVisible.length)) @@ -3067,18 +3028,6 @@ } /** - * Checks if a bonus type should stack for this game mode. - * - * @param aBonusType The bonus type - * - * @return <tt>true</tt> if bonuses of this type stack. - */ - public boolean bonusStacks( final String aBonusType ) - { - return bonusStackList.indexOf(aBonusType) != -1; // e.g. Dodge - } - - /** * Adds an <tt>AbilityCategory</tt> definition to the game mode. * * @param aCategory The <tt>AbilityCategory</tt> to add. Modified: Trunk/pcgen/code/src/java/pcgen/core/Globals.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/Globals.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/Globals.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -40,7 +40,6 @@ import java.util.MissingResourceException; import java.util.Random; import java.util.ResourceBundle; -import java.util.Set; import java.util.SortedSet; import java.util.StringTokenizer; import java.util.TreeMap; @@ -502,40 +501,7 @@ } return Collections.unmodifiableList(companionModMap.get(cList)); } - - /** - * Get companion modifier. - * @param aString - * @return companion mod - */ - public static CompanionMod getCompanionMod(final String aString) - { - if (aString.length() <= 0) - { - return null; - } - StringTokenizer aTok = new StringTokenizer(aString.substring(9), "=", false); - final String classes = aTok.nextToken(); - final int level = Integer.parseInt(aTok.nextToken()); - for ( CompanionMod cMod : getAllCompanionMods() ) - { - aTok = new StringTokenizer(classes, ",", false); - - while (aTok.hasMoreTokens()) - { - final String cString = aTok.nextToken(); - - if (cMod.getLevel(cString) == level) - { - return cMod; - } - } - } - - return null; - } - /** * Gets a <tt>Collection</tt> of all <tt>CompanionMod</tt>s registered in * the system. @@ -794,11 +760,6 @@ * @param aKey The key of the Ability to remove * @return true or false */ - public static boolean removeAbilityKeyed( final AbilityCategory aCategory, final String aKey ) - { - return abilityStore.removeKeyed(aCategory.getKeyName(), aKey); - } - // TODO - Remove this version public static boolean removeAbilityKeyed( final String aCategory, final String aKey ) { @@ -949,28 +910,6 @@ return getPObjectsOfType(abilityList, aType); } - public static Collection<String> getAbilityTypes(final AbilityCategory aCategory, final boolean visibleOnly) - { - final Set<String> typeList = new TreeSet<String>(); - for ( final Categorisable c : getUnmodifiableAbilityList(aCategory.getKeyName()) ) - { - Ability ability = null; - if ( c instanceof Ability ) - { - ability = (Ability)c; - } - else if ( c instanceof AbilityInfo ) - { - ability = ((AbilityInfo)c).getAbility(); - } - for (Type t : ability.getTrueTypeList(visibleOnly)) - { - typeList.add(t.toString()); - } - } - return Collections.unmodifiableSet(typeList); - } - /** * Get game mode AC abbreviation * @return game mode AC abbreviation @@ -2320,19 +2259,6 @@ return aList; } - /** - * Sort Pcgen Object list by key - * - * @param aList The list to be sorted. - * @return Sorted list of Pcgen Objects - */ - public static <T extends PObject> List<T> sortPObjectListByKey(final List<T> aList) - { - Collections.sort(aList, pObjectStringComp); - - return aList; - } - static String getBonusFeatString() { return SettingsHandler.getGame().getBonusFeatLevels().get(0); } @@ -2550,29 +2476,6 @@ return adjustDamage(aDamage, sizeInt(sBaseSize), sizeInt(sNewSize)); } - /** - * Efficiently search for a PObject in a list with a particular key. The list - * must be sorted by key, otherwise the search may fail find entries in the list. - * - * @param aList The list to be searched, must be sorted by key. - * @param keyName The key to be found. - * @return The object found, or null if not found. - */ - static <T extends PObject> T binarySearchPObject(final List<T> aList, final String keyName) - { - if ((keyName == null) || (keyName.length() <= 0)) - { - return null; - } - - int index = Collections.binarySearch(aList, keyName, pObjectStringComp); - if ( index >= 0 ) - { - return aList.get(index); - } - return null; - } - static double calcEncumberedMove(final Load load, final double moveInt, final boolean checkLoad) { return calcEncumberedMove(load, moveInt, checkLoad, null); Modified: Trunk/pcgen/code/src/java/pcgen/core/Movement.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/Movement.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/Movement.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -226,16 +226,6 @@ } /** - * Get a movement type at a particular index - * @param x - * @return a movement type - */ - public String getMovementTypeAt(int x) - { - return movementTypes[x]; - } - - /** * Get the movement types * @return the movement types */ @@ -245,16 +235,6 @@ } /** - * Get the movement at index x - * @param x - * @return the movement at index x - */ - public double getMovementAt(int x) - { - return movements[x].doubleValue(); - } - - /** * Get the movement at index i * @param i * @return the movement at index i or 0 @@ -339,31 +319,6 @@ return movelabel.toString(); } - /** - * Converts this Movement object into a format suitable for storage in an - * LST or equivalent file. This method should be the complement of the - * static getMovementFrom() method. - * - * @return a String in LST/PCC file format, suitable for persistent storage - */ - public String toLSTString() - { - StringBuilder txt = new StringBuilder(); - txt.append("\tMOVE"); - switch (moveRatesFlag) - { - case 2: // MOVECLONE: - txt.append("CLONE"); - break; - - default: // MOVE: - break; - } - txt.append(':'); - addTokenContents(txt); - return txt.toString(); - } - public void addTokenContents(StringBuilder txt) { if (moveRatesFlag == 2) Modified: Trunk/pcgen/code/src/java/pcgen/core/PCClass.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PCClass.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/PCClass.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -1951,28 +1951,6 @@ return cr == null ? 0 : cr.resolve(aPC, getQualifiedKey()).floatValue(); } - /* - * PCCLASSLEVELONLY Since this is level dependent it only makes sense there. - */ - public String classLevelString() - { - StringBuffer aString = new StringBuffer(); - - if (!getSubClassKey().equals(Constants.s_NONE) - && !"".equals(getSubClassKey())) - { - aString.append(getSubClassKey()); - } - else - { - aString.append(getKeyName()); - } - - aString = aString.append(' ').append(level); - - return aString.toString(); - } - @Override public PCClass clone() { Modified: Trunk/pcgen/code/src/java/pcgen/core/PObject.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PObject.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/PObject.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -617,59 +617,6 @@ } /** - * Returns true if the PC has a bonus that is currently applied - * @param aPC - * @param anObj - * @return true if the PC has a bonus that is currently applied - */ - public boolean passesPreApplied(final PlayerCharacter aPC, final PObject anObj) - { - if (!aPC.getUseTempMods()) - { - return false; - } - - // If anObj is null, use this objects tempBonusList - if (anObj == null) - { - for (BonusObj aBonus : getTempBonusList()) - { - final Object abT = aBonus.getTargetObject(); - - if (abT instanceof PlayerCharacter) - { - final PlayerCharacter bPC = (PlayerCharacter) abT; - - if (aBonus.isApplied() && (bPC == aPC)) - { - return true; - } - } - } - - return false; - } - - // else use the anObj's tempBonusList - for (BonusObj aBonus : anObj.getTempBonusList()) - { - final Object abT = aBonus.getTargetObject(); - - if (abT instanceof Equipment) - { - final Equipment aTarget = (Equipment) abT; - - if (aBonus.isApplied() && aTarget.equals(anObj)) - { - return true; - } - } - } - - return false; - } - - /** * Remove all abilities gained via a level * @param aLevel */ Modified: Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/PlayerCharacter.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -3488,15 +3488,6 @@ } /** - * Clear temp bonus filters - * - */ - public void clearTempBonusFilters() - { - tempBonusFilters.clear(); - } - - /** * set temp bonus filter * * @param aBonusStr @@ -4217,17 +4208,6 @@ /** * Cache the output index of an automatic equipment item. - * @param key The key of the equipment item. - * @param index The output index. - */ - public void cacheOutputIndex(String key, int index) - { - Logging.debugPrint("Caching " + key + " - " + index + " direct"); - autoEquipOutputOrderCache.put(key, index); - } - - /** - * Cache the output index of an automatic equipment item. * @param item The equipment item. */ public void cacheOutputIndex(Equipment item) @@ -4619,16 +4599,6 @@ return iSize; } - /** - * @param aBonus - * This will be used when I expand the functionality of the - * TempBonus tab. Please leave -- JSC 08/08/03 - */ - public void removeActiveBonus(final BonusObj aBonus) - { - activeBonusList.remove(aBonus); - } - public void removeEquipment(final Equipment eq) { if (eq.isType(Constants.s_TYPE_SPELLBOOK)) @@ -5954,14 +5924,6 @@ Constants.FEAT_CATEGORY, featName, Ability.Nature.ANY); } - public Ability getFeatNamed(final String featName, - final Ability.Nature featType) - { - return AbilityUtilities.getAbilityFromList(AbilityUtilities - .getAggregateAbilitiesListForKey(Constants.FEAT_CATEGORY, this), - Constants.FEAT_CATEGORY, featName, featType); - } - /** * Searches the characters feats for an Ability object which is a clone of * the same Base ability as the Ability passed in @@ -6666,22 +6628,6 @@ * caster level. * * @param spellType - * The type of spellcaster (i.e. "ARCANE" or "Divine") - * @param minLevel - * The desired caster level - * @return boolean - */ - public boolean isSpellCaster(final String spellType, final int minLevel) - { - return isSpellCaster(spellType, minLevel, false) > 0; - } - - /** - * Method will go through the list of classes that the player character has - * and see if they are a spell caster of the desired type and of the desired - * caster level. - * - * @param spellType * The type of spellcaster (i.e. "Arcane" or "Divine") * @param minLevel * The desired caster level @@ -6734,20 +6680,6 @@ return classTotal; } - public boolean isSpellCastermax(final int maxLevel) - { - for (PCClass pcClass : classList) - { - if (pcClass.get(StringKey.SPELLTYPE) != null - && (pcClass.getLevel() <= maxLevel)) - { - return true; - } - } - - return false; - } - public void getSpellList() { // all non-spellcaster spells are added to race @@ -6906,34 +6838,6 @@ } /** - * Computes the Caster Level for a Class - * - * @param aClass - * @return class caster level - */ - public int getClassCasterLevel(final PCClass aClass) - { - final int casterLevel = - getVariableValue("CASTERLEVEL", "CLASS:" + aClass.getKeyName()) - .intValue(); - return casterLevel; - } - - /** - * Computes the Caster Level for a race - * - * @param aRace - * @return race caster level - */ - public int getRaceCasterLevel(final Race aRace) - { - final int casterLevel = - getVariableValue("CASTERLEVEL", "RACE:" + aRace.getKeyName()) - .intValue(); - return casterLevel; - } - - /** * Calculates total bonus from all stats * * @param aType @@ -6949,61 +6853,6 @@ } /** - * return bonus from Temporary Bonuses - * - * @param aType - * @param aName - * @return temp bonus to - */ - public double getTempBonusTo(String aType, String aName) - { - double bonus = 0; - - if (!getUseTempMods()) - { - return bonus; - } - - aType = aType.toUpperCase(); - aName = aName.toUpperCase(); - - for (BonusObj bonusObj : getTempBonusList()) - { - final String bString = bonusObj.toString(); - - if ((bString.indexOf(aType) < 0) || (bString.indexOf(aName) < 0)) - { - continue; - } - - final Object tarObj = bonusObj.getTargetObject(); - final Object creObj = bonusObj.getCreatorObject(); - - if ((creObj == null) || (tarObj == null)) - { - continue; - } - - if (!(creObj instanceof CDOMObject) - || !(tarObj instanceof PlayerCharacter)) - { - continue; - } - - final PlayerCharacter bPC = (PlayerCharacter) tarObj; - - if (bPC != this) - { - continue; - } - - bonus += bonusObj.resolve(this, "").doubleValue(); - } - - return bonus; - } - - /** * Parses through all templates to calculate total bonus * * @param aType @@ -11184,20 +11033,6 @@ * * @param featType * String category of feat to list. - * @return List of Feats. - */ - public List<String> getAvailableFeatNames(final String featType) - { - return (getAvailableFeatNames(featType, false)); - } - - /** - * Returns the list of names of available feats of given type. That is, all - * feats from the global list, which match the given featType, the character - * qualifies for, and the character does not already have. - * - * @param featType - * String category of feat to list. * @param autoQualify * assume PC qualifies for feat. Used for virtual feats * @return List of Feats. @@ -11382,31 +11217,6 @@ return false; } - /** - * return the index of CharacterDomain matching domainName else return -1 - * - * @param domainKey - * @return character domain index - * @deprecated 10/21/06 thpr as part of PCClass rebuilding - */ - @Deprecated - public int getCharacterDomainIndex(final String domainKey) - { - for (int i = 0; i < characterDomainList.size(); ++i) - { - final CharacterDomain aCD = characterDomainList.get(i); - final Domain aDomain = aCD.getDomain(); - - if ((aDomain != null) - && aDomain.getKeyName().equalsIgnoreCase(domainKey)) - { - return i; - } - } - - return -1; - } - public void addFreeLanguage(final Language aLang) { this.languages.add(aLang); @@ -13216,179 +13026,6 @@ } /** - * returns the level of the highest spell in a given spellbook Yes, divine - * casters can have a "spellbook" - * - * @param aString - * @return spell levels in book - */ - int countSpellLevelsInBook(final String aString) - { - int levelNum = 0; - - final StringTokenizer aTok = new StringTokenizer(aString, "."); - final int classNum = Integer.parseInt(aTok.nextToken()); - final int sbookNum = Integer.parseInt(aTok.nextToken()); - - String bookName = Globals.getDefaultSpellBook(); - - if (sbookNum > 0) - { - bookName = getSpellBooks().get(sbookNum); - } - - final PObject aObject = getSpellClassAtIndex(classNum); - - if (aObject != null) - { - for (levelNum = 0; levelNum >= 0; ++levelNum) - { - final List<CharacterSpell> aList = - getCharacterSpells(aObject, null, bookName, levelNum); - - if (aList.size() < 1) - { - break; - } - } - } - - return levelNum; - } - - /** - * returns the number of spells based on class, level and spellbook - * - * @param aString - * @return int - */ - int countSpellListBook(final String aString) - { - final int dot = aString.lastIndexOf('.'); - int spellCount = 0; - - if (dot < 0) - { - for (PCClass pcClass : classList) - { - spellCount += getAssocCount(pcClass, AssociationListKey.CHARACTER_SPELLS); - } - } - else - { - final int classNum = Integer.parseInt(aString.substring(17, dot)); - final int levelNum = - Integer.parseInt(aString.substring(dot + 1, aString - .length() - 1)); - - final PObject aObject = getSpellClassAtIndex(classNum); - - if (aObject != null) - { - final List<CharacterSpell> aList = - getCharacterSpells(aObject, null, Globals.getDefaultSpellBook(), levelNum); - spellCount = aList.size(); - } - } - - return spellCount; - } - - /** - * returns the number of times a spell is memorised Tag looks like: - * (SPELLTIMES%class.%book.%level.%spell) aString looks - * like: SPELLTIMES2.-1.4.15 - * - * where . is a full stop (or period if you are from USA ;p) - * - * heavily stolen from replaceTokenSpellMem in ExportHandler.java - * - * @param aString - * @return spell times - */ - int countSpellTimes(final String aString) - { - boolean found = false; - final StringTokenizer aTok = - new StringTokenizer(aString.substring(10), "."); - final int classNum = Integer.parseInt(aTok.nextToken()); - final int bookNum = Integer.parseInt(aTok.nextToken()); - final int spellLevel = Integer.parseInt(aTok.nextToken()); - final int spellNumber = Integer.parseInt(aTok.nextToken()); - - final PObject aObject = getSpellClassAtIndex(classNum); - String bookName = Globals.getDefaultSpellBook(); - - if (bookNum > 0) - { - bookName = getSpellBooks().get(bookNum); - } - - if ((aObject != null) || (classNum == -1)) - { - if (classNum == -1) - { - bookName = Globals.getDefaultSpellBook(); - } - - if (!"".equals(bookName)) - { - SpellInfo si = null; - - if (classNum == -1) - { - final List<CharacterSpell> charSpellList = - new ArrayList<CharacterSpell>(); - - for (PCClass pcClass : getClassList()) - { - final List<CharacterSpell> bList = - getCharacterSpells( - pcClass, null, bookName, -1); - - for (CharacterSpell cs : bList) - { - if (!charSpellList.contains(cs)) - { - charSpellList.add(cs); - } - } - } - - Collections.sort(charSpellList); - - if (spellNumber < charSpellList.size()) - { - final CharacterSpell cs = - charSpellList.get(spellNumber); - si = cs.getSpellInfoFor(bookName, -1, -1); - found = true; - } - } - else if (aObject != null) - { - final List<CharacterSpell> charSpells = - getCharacterSpells(aObject, null, bookName, spellLevel); - - if (spellNumber < charSpells.size()) - { - final CharacterSpell cs = charSpells.get(spellNumber); - si = cs.getSpellInfoFor(bookName, spellLevel, -1); - found = true; - } - } - - if (found && (si != null)) - { - return si.getTimes(); - } - } - } - - return 0; - } - - /** * Counts the number of spells inside a spellbook Yes, divine casters can * have a "spellbook" * @@ -14892,17 +14529,6 @@ setDirty(true); } - /** - * Remove the string for the characteristic - * - * @param key - * @return string removed - */ - public String removeStringFor(StringKey key) - { - return stringChar.remove(key); - } - private Float getEquippedQty(EquipSet eSet, Equipment eqI) { final String rPath = eSet.getIdPath(); @@ -15014,105 +14640,6 @@ } /** - * Returns a list of String locations the sepcified Equipment can be - * equipped to. - * - * @param eqSet - * @param eqI - * @param containers - * @return - */ - public List<String> getEquippableLocations(EquipSet eqSet, Equipment eqI, - List<String> containers) - { - // Some Equipment locations are based on the number of hands - int hands = getHands(); - - List<String> aList = new ArrayList<String>(); - - if (eqI.isWeapon()) - { - if (eqI.isUnarmed()) - { - aList.add(Constants.S_UNARMED); - } - else if (eqI.isShield()) - { - aList.add(Constants.S_SHIELD); - } - else if (eqI.isWeaponOutsizedForPC(this)) - { - // do nothing for outsized weapons - } - else - { - if (eqI.isWeaponOneHanded(this)) - { - aList = getWeaponLocationChoices(hands, Constants.S_BOTH); - } - else - { - aList.add(Constants.S_BOTH); - } - - if (eqI.isMelee() && eqI.isDouble()) - { - aList.add(Constants.S_DOUBLE); - } - } - } - else - { - String locName = getSingleLocation(eqI); - - if (locName.length() != 0) - { - aList.add(locName); - } - else - { - aList.add(Constants.S_EQUIPPED); - } - } - - if (!eqI.isUnarmed()) - { - aList.add(Constants.S_CARRIED); - aList.add(Constants.S_NOTCARRIED); - } - - // - // Generate a list of containers - // - if (containers != null) - { - if (eqSet != null) - { - final String idPath = eqSet.getIdPath(); - - // process all EquipSet Items - for (EquipSet es : getEquipSet()) - { - String esID = - es.getParentIdPath() + EquipSet.PATH_SEPARATOR; - String abID = idPath + EquipSet.PATH_SEPARATOR; - - if (esID.startsWith(abID)) - { - Equipment eq = es.getItem(); - if ((eq != null) && eq.isContainer()) - { - containers.add(eq.getName()); - } - } - } - } - } - - return aList; - } - - /** * returns true if you can put Equipment into a location in EquipSet * * @param eSet @@ -15844,17 +15371,6 @@ theAbilities.put(aCategory, Ability.Nature.NORMAL, null); } - public int getNumberOfRealAbilities(final AbilityCategory aCategory) - { - final List<Ability> abilities = - theAbilities.get(aCategory, Ability.Nature.NORMAL); - if (abilities == null) - { - return 0; - } - return abilities.size(); - } - public HashMap<Ability.Nature, Set<Ability>> getAbilitiesSet() { @@ -16003,23 +15519,6 @@ } /** - * Returns the Feat definition searching by name, as contained in the <b> - * chosen</b> feat list. - * - * @param featName - * String key of the feat to check for. - * - * @return the Feat (not the CharacterFeat) searched for, <code>null</code> - * if not found. - */ - - public Ability getRealFeatNamed(final String featName) - { - return AbilityUtilities.getAbilityFromList(realAbilities - .get(AbilityCategory.FEAT), "FEAT", featName, Ability.Nature.ANY); - } - - /** * Does the character have this feat (not virtual or auto). * * @param aFeat @@ -16247,17 +15746,6 @@ setDirty(true); } - public void setAbilities(final AbilityCategory aCategory, final double arg) - { - if (aCategory == AbilityCategory.FEAT) - { - setFeats(arg); - return; - } - - // TODO: What about other types of ability pools? - } - public void setUserPoolBonus(final AbilityCategory aCategory, final BigDecimal anAmount) { @@ -16485,16 +15973,6 @@ return BigDecimal.valueOf(spent); } - public double getUsedAbilityCount(final AbilityCategory aCategory) - { - if (aCategory == AbilityCategory.FEAT) - { - return getUsedFeatCount(); - } - - return getAbilityPoolSpent(aCategory).doubleValue(); - } - private void setVirtualFeatsStable(final boolean stable) { virtualFeatsStable = stable; @@ -16590,27 +16068,6 @@ } - // TODO - Consolidate the various getXXXAbility functions to take a ability - // type parameter. - public Ability getVirtualAbilityKeyed(final AbilityCategory aCategory, - final String aKey) - { - if (aCategory == AbilityCategory.FEAT) - { - return getVirtualFeatKeyed(aKey); - } - - final List<Ability> abilities = getVirtualAbilityList(aCategory); - for (final Ability ability : abilities) - { - if (ability.getKeyName().equals(aKey)) - { - return ability; - } - } - return null; - } - public int addAbility(final PCLevelInfo LevelInfo, final AbilityCategory aCategory, final String aKey, final boolean addIt, final boolean singleChoice) @@ -16902,11 +16359,6 @@ return ret; } - boolean isAutomaticAbilitiesStable(final AbilityCategory aCategory) - { - return theAbilities.get(aCategory, Ability.Nature.AUTOMATIC) != null; - } - public List<Ability> getVirtualFeatList() { return getVirtualAbilityList(AbilityCategory.FEAT); Modified: Trunk/pcgen/code/src/java/pcgen/core/SourceEntry.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/SourceEntry.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/SourceEntry.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -67,23 +67,6 @@ } /** - * Constructs a new <tt>SourceEntry</tt> from the specified <tt>Map</tt> - * - * <p>The Map should contain key values for the fields and the data for the - * values. - * - * @param aSourceMap A Map of source format - source value pairs. - * - * @throws ParseException If an invalid date is specified. - */ - public SourceEntry( final Map<String, String> aSourceMap ) - throws ParseException - { - theSourceBook = Source.getSource( aSourceMap ); - thePageNumber = aSourceMap.get( SourceFormat.PAGE ); - } - - /** * Takes a <tt>Map</tt> of source type tags and values and sets the values * of the <tt>SourceEntry</tt> from it. * Deleted: Trunk/pcgen/code/src/java/pcgen/core/SpellFilter.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/SpellFilter.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/SpellFilter.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -1,86 +0,0 @@ -/* - * SpellProhibitor.java - * Copyright 2005 (c) Tom Parker <th...@so...> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Created on November 3, 2006 - * - * Current Ver: $Revision: 1522 $ - * Last Editor: $Author: thpr $ - * Last Edited: $Date: 2006-10-24 18:40:09 -0400 (Tue, 24 Oct 2006) $ - * - */ -package pcgen.core; - -public class SpellFilter { - - private String spellName; - - private String spellType; - - private int spellLevel = -1; - - public void setSpellLevel(int spellLevel) { - this.spellLevel = spellLevel; - } - - public void setSpellName(String spellName) { - this.spellName = spellName; - } - - public void setSpellType(String spellType) { - this.spellType = spellType; - } - - public boolean isEmpty() { - return spellLevel < 0 && spellType == null && spellName == null; - } - - public boolean matchesFilter(String spellKey, int testSpellLevel) { - if (spellLevel >= 0 && testSpellLevel != spellLevel) { - return false; - } - if (spellType != null && !Globals.getSpellKeyed(spellKey).isType(spellType)) { - return false; - } - if (spellName != null && !spellName.equals(spellKey)) { - return false; - } - return true; - } - - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - if (spellLevel >= 0) { - sb.append("LEVEL=").append(spellLevel); - } - if (spellType != null) { - if (sb.length() != 0) { - sb.append(","); - } - sb.append("TYPE=").append(spellType); - } - if (spellName != null) { - if (sb.length() != 0) { - sb.append(","); - } - sb.append(spellName); - } - return sb.toString(); - } - -} Modified: Trunk/pcgen/code/src/java/pcgen/core/StatList.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/StatList.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/StatList.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -129,20 +129,6 @@ return ownerPC.getVariableValue(aString, "").intValue(); } - public String getPenaltyVar(final String aStat) - { - final int x = getIndexOfStatFor(aStat); - - if (x == -1) - { - return ""; - } - - final PCStat stat = stats.get(x); - - return stat.getPenaltyVar(); - } - public int getStatModFor(final String aStat) { final int x = getIndexOfStatFor(aStat); Deleted: Trunk/pcgen/code/src/java/pcgen/core/Variable.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/Variable.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/Variable.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -1,100 +0,0 @@ -/* - * Variable.java - * Copyright 2001 (C) Bryan McRoberts <mer...@ya...> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @author Scott Ellsworth - */ -package pcgen.core; - - -/** - * A Variable is something that alters a computed variable within pcgen - * Examples include stats, saves, and base attack bonuses. - * @author Scott Ellsworth - * @version $Revision$ - */ -public class Variable -{ - /** The name of the variable. */ - private String name; - /** The formula which should be used to calculate the value of the variable. */ - private String value; - /** The level at which the variable should be applied, 0 if always.*/ - private int level; - - /** - * Create a new variable definition. - * @param level The level at which the variable should be applied, 0 if always. - * @param variableName The name of the variable. - * @param defaultFormula The formula which should be used to calculate its value. - */ - public Variable(final int level, final String variableName, final String defaultFormula) - { - this.level = level; - name = variableName; - value = defaultFormula; - } - - /** - * @return The definition of the variable (level, name and value). - */ - public String getDefinition() - { - return level + "|" + name + "|" + value; - } - - /** - * @return The variable's level. - */ - public int getLevel() - { - return level; - } - - /** - * @return The variable's name. - */ - public String getName() - { - return name; - } - - /** - * @return The variable's name in upper case. - */ - public String getUpperName() - { - return name.toUpperCase(); - } - - /** - * @return Returns the variable's value. - */ - public String getValue() - { - return value; - } - - /** - * @param value The value to set. - */ - public void setValue(final String value) - { - this.value = value; - } - -} Deleted: Trunk/pcgen/code/src/java/pcgen/core/VariableList.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/VariableList.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/VariableList.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -1,206 +0,0 @@ -/* - * VariableList.java - * Copyright 2001 (C) Bryan McRoberts <mer...@ya...> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @author Scott Ellsworth - */ -package pcgen.core; - -import java.util.*; - -/** - * <code>VariableList</code> encapsulates a list of Variable objects - * along with various methods to aid in the efficient processing of - * the variables. - * - * Last Editor: $Author$ - * Last Edited: $Date$ - * - * @author Scott Ellsworth - * @version $Revision$ - */ -public class VariableList implements Cloneable -{ - /** The list of variables. */ - private ArrayList<Variable> list = new ArrayList<Variable>(); - /** A read-only copy of the variable list for external use. */ - private List<Variable> unmodifiableList = Collections.unmodifiableList(list); - /** The set of the names in the variable list. */ - private Set<String> nameSet = null; - - /** - * Retrieve the definition of the variable at the specified - * location in the list. - * - * @param i The index of the location to be retrieved. - * @return The definition of the variable. - */ - public final String getDefinition(final int i) - { - final Variable v = list.get(i); - - return v.getDefinition(); - } - - /** - * Retrieve the variable at the specified location in the list. - * - * @param i The index of the location to be retrieved. - * @return The variable. - */ - public final Variable getVariable(final int i) - { - final Variable v = list.get(i); - - return v; - } - - /** - * Retrieve a read-only set of the variable names contained in the - * list. - * - * @return The set of names. - */ - public final Set<String> getVariableNamesAsUnmodifiableSet() - { - if (nameSet == null) - { - cacheNames(); - } - - return Collections.unmodifiableSet(nameSet); - } - - /** - * Add a new Variable to the list. - * - * @param level The level at which the variable should be applied, 0 if always. - * @param variableName The name of the variable. - * @param defaultFormula The formula which should be used to calculate its value. - */ - public final void add(final int level, final String variableName, final String defaultFormula) - { - final Variable v = new Variable(level, variableName, defaultFormula); - list.add(v); - clearNameCache(); - } - - /** - * Remove all entries from the list of variables. - */ - public void clear() - { - list.clear(); - nameSet = null; - } - - /** - * @see java.lang.Object#clone() - */ - @Override - public Object clone() throws CloneNotSupportedException - { - final VariableList retVal = (VariableList) super.clone(); - retVal.list = (ArrayList<Variable>) list.clone(); - - return retVal; - } - - /** - * Check if a named variable is held. - * - * @param variableName The name to be checked for. - * @return True if the variable is present, false otherwise. - */ - public final boolean hasVariableNamed(final String variableName) - { - final String upperName = variableName.toUpperCase(); - - if (nameSet == null) - { - cacheNames(); - } - - return nameSet.contains(upperName); - } - - /** - * Retrieve an iterator over a read-only copy of the variable list. - * - * @return The iterator. - */ - public final Iterator<Variable> iterator() - { - return unmodifiableList.iterator(); - } - - /** - * Set a specific index in the list to a new Variable. - * - * @param idx The index to be set. - * @param level The level at which the variable should be applied, 0 if always. - * @param variableName The name of the variable. - * @param defaultFormula The formula which should be used to calculate its value. - */ - public final void set(final int idx, final int level, final String variableName, final String defaultFormula) - { - final Variable v = new Variable(level, variableName, defaultFormula); - list.set(idx, v); - clearNameCache(); - } - - /** - * Retrieve the number of entries in the list. - * @return The size of the list. - */ - public final int size() - { - return list.size(); - } - - /** - * Add all entries from another VariableList to this VariableList. Note the - * added entries will be shared with both lists. - * @param vOther The list of Variables to be added. - */ - protected final void addAll(final VariableList vOther) - { - list.addAll(vOther.list); - clearNameCache(); - } - - /** - * Populate nameSet, the set of the names in the variable list. - */ - private final void cacheNames() - { - nameSet = new HashSet<String>(); - - for ( Variable v : list ) - { - nameSet.add(v.getUpperName()); - } - } - - /** - * Clear nameSet, the set of the names in the variable list. - */ - private final void clearNameCache() - { - nameSet = null; - } -} Deleted: Trunk/pcgen/code/src/java/pcgen/core/analysis/LanguageSupport.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/analysis/LanguageSupport.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/analysis/LanguageSupport.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -1,79 +0,0 @@ -/* - * Copyright 2008 (C) Tom Parker <th...@us...> - * Derived from PObject.java - * Copyright 2001 (C) Bryan McRoberts <mer...@ya...> - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -package pcgen.core.analysis; - -import java.util.SortedSet; -import java.util.StringTokenizer; -import java.util.TreeSet; - -import pcgen.core.Globals; -import pcgen.core.Language; -import pcgen.rules.context.AbstractReferenceContext; -import pcgen.util.Logging; - -public class LanguageSupport -{ - - /** - * Returns a list of Language objects from a string of choices. The method - * will expand "ALL" or "ANY" into all languages and TYPE= into all - * languages of that type - * @param stringList Pipe separated list of language choices - * @return Sorted list of Language objects - */ - public static SortedSet<Language> getLanguagesFromString(final String stringList) - { - SortedSet<Language> list = new TreeSet<Language>(); - - final StringTokenizer tokens = new StringTokenizer(stringList, "|", false); - - AbstractReferenceContext ref = Globals.getContext().ref; - while (tokens.hasMoreTokens()) - { - final String aLang = tokens.nextToken(); - if ("ALL".equals(aLang)) - { - list.addAll(ref.getConstructedCDOMObjects(Language.class)); - return list; - } - else if (aLang.startsWith("TYPE=") || aLang.startsWith("TYPE.")) - { - list.addAll(Globals.getPObjectsOfType(ref - .getConstructedCDOMObjects(Language.class), aLang - .substring(5))); - } - else - { - Language languageKeyed = ref - .silentlyGetConstructedCDOMObject(Language.class, aLang); - if (languageKeyed == null) - { - Logging.debugPrint("Someone expected Language: " + aLang + " to exist: it doesn't"); - } - else - { - list.add(languageKeyed); - } - } - } - return list; - } - -} Modified: Trunk/pcgen/code/src/java/pcgen/core/character/SpellInfo.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/character/SpellInfo.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/character/SpellInfo.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -57,14 +57,6 @@ private int actualSpellPointCost = 0; private int numPages = 0; - /** - * added package-private constructor to enforce usage of public constructor - */ - SpellInfo() - { - // Empty Constructor - } - SpellInfo(final CharacterSpell owner, final int actualLevel, final int times, final String book) { Modified: Trunk/pcgen/code/src/java/pcgen/core/prereq/PrereqHandler.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/prereq/PrereqHandler.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/prereq/PrereqHandler.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -29,14 +29,12 @@ import java.util.Collection; -import java.util.List; import pcgen.cdom.base.CDOMObject; import pcgen.core.Ability; import pcgen.core.Equipment; import pcgen.core.Globals; import pcgen.core.PCClass; -import pcgen.core.PObject; import pcgen.core.PlayerCharacter; import pcgen.core.RuleConstants; import pcgen.persistence.PersistenceLayerException; @@ -160,38 +158,6 @@ return true; } - public static boolean passesAtLeastOne(final List<Prerequisite> prereqList, final PlayerCharacter character, final PObject caller) - { - if (prereqList == null) - { - return true; - } - for ( Prerequisite element : prereqList ) - { - if (passes(element, character, caller)) - { - return true; - } - } - return false; - } - - public static boolean passesAtLeastOne(final List<Prerequisite> prereqList, final Equipment equip, PlayerCharacter currentPC) - { - if (prereqList == null) - { - return true; - } - for ( Prerequisite element : prereqList ) - { - if (passes(element, equip, currentPC)) - { - return true; - } - } - return false; - } - /** * Returns true if the character passes the prereq * @param prereq The prerequisite to pass Modified: Trunk/pcgen/code/src/java/pcgen/core/prereq/Prerequisite.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/prereq/Prerequisite.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/prereq/Prerequisite.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -577,18 +577,6 @@ && (categoryName == null || categoryName.equals(other.categoryName)); } - boolean deprecated = false; - - public void setDeprecated() - { - deprecated = true; - } - - public boolean isDeprecated() - { - return deprecated; - } - /** * Checks if a character is required to test this prerequisite. * Modified: Trunk/pcgen/code/src/java/pcgen/core/utils/CoreUtility.java =================================================================== --- Trunk/pcgen/code/src/java/pcgen/core/utils/CoreUtility.java 2008-12-07 03:23:41 UTC (rev 8586) +++ Trunk/pcgen/code/src/java/pcgen/core/utils/CoreUtility.java 2008-12-07 03:24:47 UTC (rev 8587) @@ -26,10 +26,8 @@ import java.net.URL; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.Comparator; -import java.util.Iterator; import java.util.List; import java.util.regex.Pattern; @@ -123,68 +121,8 @@ } /** - * Converts an array of Objects into a List of Objects - * - * @param array - * the array to be converted. If this array is null then this - * method will return an empty list; - * - * @return The list containing the objects passed in. - * - * CONSIDER This should really be eliminated, as the only value over - * Arrays.asList is the null check... - thpr 11/3/06 - */ - public static <T> List<T> arrayToList(final T[] array) - { - if (array == null) - { - return new ArrayList<T>(); - } - - final List<T> list = new ArrayList<T>(array.length); - list.addAll(Arrays.asList(array)); - return list; - } - - /** - * Verifies that a string is all numeric (integer). - * - * @param numString - * String to check if all numeric [integer] - * @return true if the String is numeric, else false - */ - public static boolean isIntegerString(final String numString) - { - boolean result; - - try - { - Integer.parseInt(numString); - result = true; - } - catch (NumberFormatException nfe) - { - result = false; - } - - return result; - } - - /** * return true if the protocol of the URL represented is FTP or HTTP * - * @param URLString - * the URL to test for a network protocol - * @return true if the string begins with FTP or HTTP - */ - public static boolean isNetURL(final String URLString) - { - return (URLString.startsWith("http:") || URLString.startsWith("ftp:")); - } - - /** - * return true if the protocol of the URL represented is FTP or HTTP - * * @param url * the URL object to test for a network protocol * @return true if the protocol of this URL is FTP or HTTP @@ -196,19 +134,6 @@ } /** - * return true if the proto... [truncated message content] |