|
From: <nu...@us...> - 2011-05-30 10:02:27
|
Revision: 15066
http://pcgen.svn.sourceforge.net/pcgen/?rev=15066&view=rev
Author: nuance
Date: 2011-05-30 10:02:18 +0000 (Mon, 30 May 2011)
Log Message:
-----------
CheckStyle updates.
Modified Paths:
--------------
Trunk/pcgen/code/src/java/pcgen/cdom/base/Constants.java
Trunk/pcgen/code/src/java/plugin/bonustokens/AbilityPool.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Checks.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Combat.java
Trunk/pcgen/code/src/java/plugin/bonustokens/DC.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Domain.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Eqm.java
Trunk/pcgen/code/src/java/plugin/bonustokens/EqmArmor.java
Trunk/pcgen/code/src/java/plugin/bonustokens/EqmWeapon.java
Trunk/pcgen/code/src/java/plugin/bonustokens/HD.java
Trunk/pcgen/code/src/java/plugin/bonustokens/HP.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Lang.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Languages.java
Trunk/pcgen/code/src/java/plugin/bonustokens/LoadMult.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Misc.java
Trunk/pcgen/code/src/java/plugin/bonustokens/ModSkillPoints.java
Trunk/pcgen/code/src/java/plugin/bonustokens/MonSkillPts.java
Trunk/pcgen/code/src/java/plugin/bonustokens/MoveAdd.java
Trunk/pcgen/code/src/java/plugin/bonustokens/MoveMult.java
Trunk/pcgen/code/src/java/plugin/bonustokens/PostMoveAdd.java
Trunk/pcgen/code/src/java/plugin/bonustokens/PostRangeAdd.java
Trunk/pcgen/code/src/java/plugin/bonustokens/RangeAdd.java
Trunk/pcgen/code/src/java/plugin/bonustokens/RangeMult.java
Trunk/pcgen/code/src/java/plugin/bonustokens/SizeMod.java
Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnown.java
Trunk/pcgen/code/src/java/plugin/bonustokens/SpellPointCosts.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Stat.java
Trunk/pcgen/code/src/java/plugin/bonustokens/UDam.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Var.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Vision.java
Trunk/pcgen/code/src/java/plugin/converter/FavClassConvertPlugin.java
Trunk/pcgen/code/src/java/plugin/lsttokens/TemplateLst.java
Modified: Trunk/pcgen/code/src/java/pcgen/cdom/base/Constants.java
===================================================================
--- Trunk/pcgen/code/src/java/pcgen/cdom/base/Constants.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/pcgen/cdom/base/Constants.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -443,6 +443,12 @@
String LST_CAST_EQUAL = "CAST=";
/** A snippet of List code as a constant. */
+ String LST_CLASS_DOT = "CLASS.";
+
+ /** A snippet of List code as a constant. */
+ String LST_CLASS_EQUAL = "CLASS=";
+
+ /** A snippet of List code as a constant. */
String LST_SHIELDTYPE_DOT = "SHIELDTYPE.";
/** A snippet of List code as a constant. */
@@ -460,49 +466,72 @@
/** A snippet of List code as a constant. */
String LST_NOT_TYPE_EQUAL = "!TYPE=";
+
/** A snippet of List code as a constant. */
- String LST_ALL = "ALL";
+ String LST_PERCENT_CHOICE = "%CHOICE";
/** A snippet of List code as a constant. */
- String LST_ANY = "ANY";
+ String LST_PERCENT_LIST = "%LIST";
/** A snippet of List code as a constant. */
- String LST_LIST = "LIST";
+ String LST_CHOOSE_COLON = "CHOOSE:";
/** A snippet of List code as a constant. */
- String LST_PERCENT_CHOICE = "%CHOICE";
+ String LST_ADD_CHOICE_COLON = "ADDCHOICE:";
+
/** A snippet of List code as a constant. */
- String LST_PERCENT_LIST = "%LIST";
+ String LST_ALL = "ALL";
/** A snippet of List code as a constant. */
- String LST_NONE = "NONE";
+ String LST_ANY = "ANY";
/** A snippet of List code as a constant. */
- String LST_CHOOSE = "CHOOSE:";
+ String LST_CROSS_CLASS = "CROSSCLASSSKILLS";
/** A snippet of List code as a constant. */
- String LST_ADD_CHOICE = "ADDCHOICE:";
+ String LST_CHOICE = "CHOICE";
/** A snippet of List code as a constant. */
- String LST_UNTRAINED = "UNTRAINED";
+ String LST_CLASS = "CLASS";
/** A snippet of List code as a constant. */
- String LST_TRAINED = "TRAINED";
+ String LST_DESCRIPTOR = "DESCRIPTOR";
/** A snippet of List code as a constant. */
+ String LST_DOMAIN = "DOMAIN";
+
+ /** A snippet of List code as a constant. */
String LST_EXCLUSIVE = "EXCLUSIVE";
/** A snippet of List code as a constant. */
+ String LST_LIST = "LIST";
+
+ /** A snippet of List code as a constant. */
+ String LST_NONE = "NONE";
+
+ /** A snippet of List code as a constant. */
String LST_NONEXCLUSIVE = "NONEXCLUSIVE";
+ /** A snippet of List code as a constant. */
+ String LST_SCHOOL = "SCHOOL";
/** A snippet of List code as a constant. */
- String LST_CROSS_CLASS = "CROSSCLASSSKILLS";
+ String LST_SUBSCHOOL = "SUBSCHOOL";
/** A snippet of List code as a constant. */
- String LST_CHOICE = "CHOICE";
+ String LST_SPELL = "SPELL";
+ /** A snippet of List code as a constant. */
+ String LST_TRAINED = "TRAINED";
+
+ /** A snippet of List code as a constant. */
+ String LST_TYPE = "TYPE";
+
+ /** A snippet of List code as a constant. */
+ String LST_UNTRAINED = "UNTRAINED";
+
+
/** A constant used in List parsing of Favoured Class. */
String HIGHEST_LEVEL_CLASS = "HIGHESTLEVELCLASS";
@@ -615,6 +644,10 @@
/**
* The length of various LST constants that need to stripped from the front of a string during parsing. */
+ int SUBSTRING_LENGTH_SIX = 6;
+
+ /**
+ * The length of various LST constants that need to stripped from the front of a string during parsing. */
int SUBSTRING_LENGTH_SEVEN = 7;
/**
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/AbilityPool.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/AbilityPool.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/AbilityPool.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -29,8 +29,6 @@
/**
* Handles the BONUS:ABILITYPOOL token.
- *
- * @author boomer70 <boo...@ya...>
*/
public final class AbilityPool extends BonusObj
{
@@ -63,8 +61,8 @@
}
/**
- * Return a list of the bonuses handled by this class.
- * @return A list of the bonuses handled by this class.
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
*/
@Override
public String getBonusHandled()
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Checks.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Checks.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Checks.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -146,6 +146,10 @@
private static CheckInfo listCheck = new CheckInfo(null, false);
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Combat.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Combat.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Combat.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,33 +28,46 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>Combat</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:COMBAT token.
*/
public final class Combat extends MultiTagBonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{"AC", "ATTACKS", "ATTACKS-SECONDARY", "BAB", "DAMAGE",
"DAMAGESIZE", "DAMAGE-PRIMARY", "DAMAGE-SECONDARY",
"DAMAGE-SHORTRANGE", "DEFENSE", "INITIATIVE", "REACH", "TOHIT",
"TOHIT-PRIMARY", "TOHIT-SECONDARY", "TOHIT-SHORTRANGE"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "COMBAT";
}
+ /**
+ * Get by index, an individual combat attribute that may be bonused.
+ * @param tagNumber the index of the combat attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The combat attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of combat attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of combat attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/DC.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/DC.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/DC.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -25,74 +25,85 @@
*/
package plugin.bonustokens;
+import pcgen.cdom.base.Constants;
import pcgen.core.bonus.BonusObj;
import pcgen.rules.context.LoadContext;
/**
- * <code>DC</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:DC token.
*/
public final class DC extends BonusObj
{
- private static final String[] bonusTags = {"FEATBONUS", "ALLSPELLS"};
+ private static final String[] BONUS_TAGS = {"FEATBONUS", "ALLSPELLS"};
/*
- * is either a bonusTag[]
+ * When parsing the token, valid tokens are either a bonusTag[]
* or:
* CLASS.<ClassName>
- * DESCRIPTOR.<Descrpt>
+ * DESCRIPTOR.<Description>
* DOMAIN.<DomainName>
* SCHOOL.<SchoolName>
* SUBSCHOOL.<SubSchoolName>
* TYPE.<CasterType>
* SPELL.<SpellName>
*/
+
+ /**
+ * Parse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#parseToken(LoadContext, java.lang.String)
+ * @return True if successfully parsed.
+ */
@Override
protected boolean parseToken(LoadContext context, final String token)
{
- for (int i = 0; i < bonusTags.length; ++i)
+ for (int i = 0; i < BONUS_TAGS.length; ++i)
{
- if (token.equals(bonusTags[i]))
+ if (token.equals(BONUS_TAGS[i]))
{
- addBonusInfo(Integer.valueOf(i));
+ addBonusInfo(i);
return true;
}
}
- // Must remove the %LIST if present
+ boolean valid = token.startsWith(Constants.LST_CLASS);
+ valid = valid || token.startsWith(Constants.LST_DESCRIPTOR);
+ valid = valid || token.startsWith(Constants.LST_DOMAIN);
+ valid = valid || token.startsWith(Constants.LST_SCHOOL);
+ valid = valid || token.startsWith(Constants.LST_SUBSCHOOL);
+ valid = valid || token.startsWith(Constants.LST_TYPE);
+ valid = valid || token.startsWith(Constants.LST_SPELL);
- /*
- if (token.indexOf(".%LIST") > 0)
- {
- token = token.substring(0, token.indexOf(".%LIST"));
- }
- */
- if (token.startsWith("CLASS") || token.startsWith("DESCRIPTOR")
- || token.startsWith("DOMAIN") || token.startsWith("SCHOOL")
- || token.startsWith("SUBSCHOOL") || token.startsWith("TYPE")
- || token.startsWith("SPELL"))
+ if (valid)
{
addBonusInfo(token);
return true;
}
-
return false;
}
+ /**
+ * Unparse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#unparseToken(java.lang.Object)
+ * @param obj The object to unparse
+ * @return The unparsed string.
+ */
@Override
protected String unparseToken(final Object obj)
{
if (obj instanceof Integer)
{
- return bonusTags[((Integer) obj).intValue()];
+ return BONUS_TAGS[(Integer) obj];
}
return (String) obj;
}
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Domain.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Domain.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Domain.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>Domain</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:DOMAIN token.
*/
public final class Domain extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"NUMBER"};
+ private static final String[] BONUS_TAGS = {"NUMBER"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "DOMAIN";
}
+ /**
+ * Get by index, an individual attribute of a domain that may be bonused.
+ * @param tagNumber the index of the domain attribute type.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The domain attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of domain attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of domain attribute.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Eqm.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Eqm.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Eqm.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,30 +28,43 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>Eqm</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:EQM token.
*/
public final class Eqm extends MultiTagBonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{"WEIGHTADD", "WEIGHTDIV", "WEIGHTMULT"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "EQM";
}
+ /**
+ * Get by index, an individual equipment attribute that may be bonused.
+ * @param tagNumber the index of the equipment attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The equipment attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of equipment attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of equipment attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/EqmArmor.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/EqmArmor.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/EqmArmor.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,30 +28,43 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>EqmArmor</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:EQMARMOR token.
*/
public final class EqmArmor extends MultiTagBonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{"AC", "ACCHECK", "DEFBONUS", "EDR", "MAXDEX", "SPELLFAILURE"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "EQMARMOR";
}
+ /**
+ * Get by index, an individual armour equipment attribute that may be bonused.
+ * @param tagNumber the index of the equipment attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The equipment attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of armour equipment attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of equipment attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/EqmWeapon.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/EqmWeapon.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/EqmWeapon.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,31 +28,44 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>EqmWeapon</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:EQMWEAPON token.
*/
public final class EqmWeapon extends MultiTagBonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{"CRITRANGEADD", "CRITRANGEDOUBLE", "DAMAGESIZE", "RANGEADD",
"RANGEMULT"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "EQMWEAPON";
}
+ /**
+ * Get by index, an individual weapon equipment attribute that may be bonused.
+ * @param tagNumber the index of the equipment attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The equipment attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of weapon equipment attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of equipment attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/HD.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/HD.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/HD.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -34,23 +34,38 @@
*/
public final class HD extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"MAX", "MIN"};
+ private static final String[] BONUS_TAGS = {"MAX", "MIN"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "HD";
}
+ /**
+ * Get by index, an individual hit die attribute that may be bonused.
+ * @param tagNumber the index of the hit die attribute .
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The hit die attribute .
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of hit die attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of hit die attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/HP.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/HP.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/HP.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,30 +28,43 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>HP</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:HP token.
*/
public final class HP extends MultiTagBonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{"BONUS", "CURRENTMAX", "CURRENTMAXPERLEVEL", "ALTHP"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "HP";
}
+ /**
+ * Get by index, an individual hit point attribute that may be bonused.
+ * @param tagNumber the index of the hit point attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The hit point attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of hit point attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of hit point attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Lang.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Lang.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Lang.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>Lang</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:LANG token.
*/
public final class Lang extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"BONUS"};
+ private static final String[] BONUS_TAGS = {"BONUS"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "LANG";
}
+ /**
+ * Get by index, an individual language attribute that may be bonused.
+ * @param tagNumber the index of the language attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The language attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of language attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of language attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Languages.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Languages.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Languages.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>Languages</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:LANGUAGES token.
*/
public final class Languages extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"NUMBER"};
+ private static final String[] BONUS_TAGS = {"NUMBER"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "LANGUAGES";
}
+ /**
+ * Get by index, an individual language attribute that may be bonused.
+ * @param tagNumber the index of the language attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The language attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of language attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of language attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/LoadMult.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/LoadMult.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/LoadMult.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>LoadMult</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:LOADMULT token.
*/
public final class LoadMult extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"TYPE.SIZE", "TYPE=SIZE"};
+ private static final String[] BONUS_TAGS = {"TYPE.SIZE", "TYPE=SIZE"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "LOADMULT";
}
+ /**
+ * Get by index, an individual load mult attribute that may be bonused.
+ * @param tagNumber the index of the load mult attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The load mult attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of load mult attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of load mult attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Misc.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Misc.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Misc.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -27,31 +27,44 @@
import pcgen.core.bonus.MultiTagBonusObj;
-/**
- * <code>Misc</code>
- *
- * @author Greg Bingleman <by...@ho...>
+/**MISC
+ * Handles the BONUS:MISC token.
*/
public final class Misc extends MultiTagBonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{"ACCHECK", "MAXDEX", "SPELLFAILURE", "SR", "CR"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "MISC";
}
+ /**
+ * Get by index, an individual miscellaneous attribute that may be bonused.
+ * @param tagNumber the index of the miscellaneous attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The miscellaneous attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of miscellaneous attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of miscellaneous attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/ModSkillPoints.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/ModSkillPoints.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/ModSkillPoints.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>ModSkillPoints</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:MODSKILLPOINTS token.
*/
public final class ModSkillPoints extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"NUMBER"};
+ private static final String[] BONUS_TAGS = {"NUMBER"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "MODSKILLPOINTS";
}
+ /**
+ * Get by index, an individual attribute that may be bonused.
+ * @param tagNumber the index of the skill point attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The skill point attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of skill point attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of skill point attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/MonSkillPts.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/MonSkillPts.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/MonSkillPts.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>MonSkillPts</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:MONSKILLPTS token.
*/
public final class MonSkillPts extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"NUMBER", "LOCKNUMBER"};
+ private static final String[] BONUS_TAGS = {"NUMBER", "LOCKNUMBER"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "MONSKILLPTS";
}
+ /**
+ * Get by index, an individual monster skill point attribute that may be bonused.
+ * @param tagNumber the index of the monster skill point attribute type.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The type of monster skill point attribute .
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of types of monster skill point attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of monster skill point attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/MoveAdd.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/MoveAdd.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/MoveAdd.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -1,5 +1,5 @@
/*
- * Move.java
+ * MoveAdd.java
* Copyright 2002 (C) Greg Bingleman <by...@ho...>
*
* This library is free software; you can redistribute it and/or
@@ -25,35 +25,39 @@
*/
package plugin.bonustokens;
+import pcgen.cdom.base.Constants;
import pcgen.core.bonus.BonusObj;
import pcgen.rules.context.LoadContext;
import pcgen.util.enumeration.Load;
/**
- * <code>Move</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:MOVEADD token.
**/
public final class MoveAdd extends BonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{Load.LIGHT.toString(), Load.MEDIUM.toString(),
Load.HEAVY.toString(), Load.OVERLOAD.toString()};
+ /**
+ * Parse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#parseToken(LoadContext, java.lang.String)
+ * @return True if successfully parsed.
+ */
@Override
protected boolean parseToken(LoadContext context, final String token)
{
- for (int i = 0; i < bonusTags.length; ++i)
+ for (int i = 0; i < BONUS_TAGS.length; ++i)
{
- if (bonusTags[i].equals(token))
+ if (BONUS_TAGS[i].equals(token))
{
- addBonusInfo(Integer.valueOf(i));
+ addBonusInfo(i);
return true;
}
}
- if (token.startsWith("TYPE="))
+ if (token.startsWith(Constants.LST_TYPE_EQUAL))
{
addBonusInfo(token.replace('=', '.'));
}
@@ -65,17 +69,27 @@
return true;
}
+ /**
+ * Unparse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#unparseToken(java.lang.Object)
+ * @param obj The object to unparse
+ * @return The unparsed string.
+ */
@Override
protected String unparseToken(final Object obj)
{
if (obj instanceof Integer)
{
- return bonusTags[((Integer) obj).intValue()];
+ return BONUS_TAGS[(Integer) obj];
}
return (String) obj;
}
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/MoveMult.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/MoveMult.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/MoveMult.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -1,5 +1,5 @@
/*
- * Move.java
+ * MoveMult.java
* Copyright 2002 (C) Greg Bingleman <by...@ho...>
*
* This library is free software; you can redistribute it and/or
@@ -25,35 +25,39 @@
*/
package plugin.bonustokens;
+import pcgen.cdom.base.Constants;
import pcgen.core.bonus.BonusObj;
import pcgen.rules.context.LoadContext;
import pcgen.util.enumeration.Load;
/**
- * <code>Move</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:MOVEMULT token.
**/
public final class MoveMult extends BonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{Load.LIGHT.toString(), Load.MEDIUM.toString(),
Load.HEAVY.toString(), Load.OVERLOAD.toString()};
+ /**
+ * Parse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#parseToken(LoadContext, java.lang.String)
+ * @return True if successfully parsed.
+ */
@Override
protected boolean parseToken(LoadContext context, final String token)
{
- for (int i = 0; i < bonusTags.length; ++i)
+ for (int i = 0; i < BONUS_TAGS.length; ++i)
{
- if (bonusTags[i].equals(token))
+ if (BONUS_TAGS[i].equals(token))
{
- addBonusInfo(Integer.valueOf(i));
+ addBonusInfo(i);
return true;
}
}
- if (token.startsWith("TYPE="))
+ if (token.startsWith(Constants.LST_TYPE_EQUAL))
{
addBonusInfo(token.replace('=', '.'));
}
@@ -65,17 +69,27 @@
return true;
}
+ /**
+ * Unparse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#unparseToken(java.lang.Object)
+ * @param obj The object to unparse
+ * @return The unparsed string.
+ */
@Override
protected String unparseToken(final Object obj)
{
if (obj instanceof Integer)
{
- return bonusTags[((Integer) obj).intValue()];
+ return BONUS_TAGS[(Integer) obj];
}
return (String) obj;
}
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/PostMoveAdd.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/PostMoveAdd.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/PostMoveAdd.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -25,35 +25,39 @@
*/
package plugin.bonustokens;
+import pcgen.cdom.base.Constants;
import pcgen.core.bonus.BonusObj;
import pcgen.rules.context.LoadContext;
import pcgen.util.enumeration.Load;
/**
- * <code>Move</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:POSTMOVEADD token.
**/
public final class PostMoveAdd extends BonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{Load.LIGHT.toString(), Load.MEDIUM.toString(),
Load.HEAVY.toString(), Load.OVERLOAD.toString()};
+ /**
+ * Parse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#parseToken(LoadContext, java.lang.String)
+ * @return True if successfully parsed.
+ */
@Override
protected boolean parseToken(LoadContext context, final String token)
{
- for (int i = 0; i < bonusTags.length; ++i)
+ for (int i = 0; i < BONUS_TAGS.length; ++i)
{
- if (bonusTags[i].equals(token))
+ if (BONUS_TAGS[i].equals(token))
{
- addBonusInfo(Integer.valueOf(i));
+ addBonusInfo(i);
return true;
}
}
- if (token.startsWith("TYPE="))
+ if (token.startsWith(Constants.LST_TYPE_EQUAL))
{
addBonusInfo(token.replace('=', '.'));
}
@@ -65,17 +69,27 @@
return true;
}
+ /**
+ * Unparse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#unparseToken(java.lang.Object)
+ * @param obj The object to unparse
+ * @return The unparsed string.
+ */
@Override
protected String unparseToken(final Object obj)
{
if (obj instanceof Integer)
{
- return bonusTags[((Integer) obj).intValue()];
+ return BONUS_TAGS[(Integer) obj];
}
return (String) obj;
}
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/PostRangeAdd.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/PostRangeAdd.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/PostRangeAdd.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>PostRangeAdd</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:POSTRANGEADD token.
*/
public final class PostRangeAdd extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"PROJECTILE", "THROWN"};
+ private static final String[] BONUS_TAGS = {"PROJECTILE", "THROWN"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "POSTRANGEADD";
}
+ /**
+ * Get by index, an individual range attribute that may be bonused.
+ * @param tagNumber the index of the range attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The range attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of range attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of range attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/RangeAdd.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/RangeAdd.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/RangeAdd.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>RangeAdd</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:RANGEADD token.
*/
public final class RangeAdd extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"PROJECTILE", "THROWN"};
+ private static final String[] BONUS_TAGS = {"PROJECTILE", "THROWN"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "RANGEADD";
}
+ /**
+ * Get by index, an individual range attribute that may be bonused.
+ * @param tagNumber the index of the range attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The range attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of range attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of range attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/RangeMult.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/RangeMult.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/RangeMult.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>RangeMult</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:RANGEMULT token.
*/
public final class RangeMult extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"PROJECTILE", "THROWN"};
+ private static final String[] BONUS_TAGS = {"PROJECTILE", "THROWN"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "RANGEMULT";
}
+ /**
+ * Get by index, an individual range attribute that may be bonused.
+ * @param tagNumber the index of the range attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The range attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of range attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of range attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/SizeMod.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/SizeMod.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/SizeMod.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>SizeMod</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:SIZEMOD token.
*/
public final class SizeMod extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"NUMBER",};
+ private static final String[] BONUS_TAGS = {"NUMBER", };
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "SIZEMOD";
}
+ /**
+ * Get by index, an individual type of SizeMOD that may be bonused.
+ * @param tagNumber the index of the SizeMOD type.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The type of SizeMOD.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of types of SizeMod that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of SizeMOD types.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnown.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnown.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnown.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -90,8 +90,8 @@
}
/**
- * Return a list of the bonuses handled by this class.
- * @return A list of the bonuses handled by this class.
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
*/
@Override
public String getBonusHandled()
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/SpellPointCosts.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/SpellPointCosts.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/SpellPointCosts.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -1,5 +1,24 @@
-/**
- *
+/*
+ * SpellPointCosts.java
+ * Copyright 2006 (C) Joe Frazier
+ *
+ * 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 Ver: $Revision: $
+ * Last Editor: $Author: $
+ * Last Edited: $Date: $
*/
package plugin.bonustokens;
@@ -12,19 +31,23 @@
import pcgen.util.Logging;
/**
- * @author Joe.Frazier
- *
+ * Handles the BONUS:SPELLPOINTCOSTS token.
*/
public class SpellPointCosts extends BonusObj
{
+ /**
+ * Parse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#parseToken(LoadContext, java.lang.String)
+ * @return True if successfully parsed.
+ */
@Override
protected boolean parseToken(LoadContext context, final String token)
{
- SpellPointCostInfo spi = null;
- SpellPointFilterType type =null;
- String typeValue =null;
- String part = null;
-
+ SpellPointCostInfo spi;
+ SpellPointFilterType type;
+ String typeValue;
+ String part;
+
if (token == null)
{
Logging.errorPrint("Malformed BONUS:SPELLPOINTCOST.");
@@ -70,8 +93,9 @@
part = "TOTAL";
}
-
- if(type == null || typeValue == null || part == null)
+
+ // Type cannot be null at this point
+ if(typeValue == null || part == null)
{
Logging.errorPrint("Malformed BONUS:SPELLPOINTCOST: " + token);
return false;
@@ -83,7 +107,13 @@
return true;
}
-
+
+ /**
+ * Unparse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#unparseToken(java.lang.Object)
+ * @param obj The object to unparse
+ * @return The unparsed string.
+ */
@Override
protected String unparseToken(Object obj)
{
@@ -99,10 +129,13 @@
return sb.toString();
}
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "SPELLPOINTCOST";
}
-
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Stat.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Stat.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Stat.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -143,6 +143,10 @@
}
}
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/UDam.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/UDam.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/UDam.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -25,48 +25,67 @@
*/
package plugin.bonustokens;
+import pcgen.cdom.base.Constants;
import pcgen.core.Globals;
import pcgen.core.PCClass;
import pcgen.core.bonus.BonusObj;
import pcgen.rules.context.LoadContext;
+import pcgen.rules.context.ReferenceContext;
import pcgen.util.Logging;
/**
- * <code>UDam</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:UDam token.
*/
public final class UDam extends BonusObj
{
+ /**
+ * Parse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#parseToken(LoadContext, java.lang.String)
+ * @return True if successfully parsed.
+ */
@Override
protected boolean parseToken(LoadContext context, final String token)
{
- if (token.startsWith("CLASS=") || token.startsWith("CLASS."))
+ if (token.startsWith(Constants.LST_CLASS_EQUAL)
+ || token.startsWith(Constants.LST_CLASS_DOT))
{
- addBonusInfo(token.substring(6));
+ addBonusInfo(token.substring(Constants.SUBSTRING_LENGTH_SIX));
return true;
}
- Logging.errorPrint("BONUS:UDAM syntax must have "
- + "Info (2nd arg to BONUS) start with CLASS= or CLASS. ");
+ Logging.errorPrint(
+ "BONUS:UDAM syntax must have Info (2nd arg to BONUS) start with CLASS= or CLASS. ");
return false;
}
+ /**
+ * Unparse the bonus token.
+ * @see pcgen.core.bonus.BonusObj#unparseToken(java.lang.Object)
+ * @param obj The object to unparse
+ * @return The unparsed string.
+ */
@Override
protected String unparseToken(final Object obj)
{
if (obj instanceof String)
{
- final PCClass aClass = Globals.getContext().ref.silentlyGetConstructedCDOMObject(PCClass.class, ((String) obj));
+ String sObj = (String) obj;
+ final ReferenceContext ref = Globals.getContext().ref;
+ final PCClass aClass = ref.silentlyGetConstructedCDOMObject(PCClass.class, sObj);
+
if (aClass != null)
{
replaceBonusInfo(obj, aClass);
}
- return "CLASS." + obj;
+ return Constants.LST_CLASS_DOT + obj;
}
- return "CLASS." + ((PCClass) obj).getKeyName();
+ return Constants.LST_CLASS_DOT + ((PCClass) obj).getKeyName();
}
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Var.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Var.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Var.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -61,8 +61,8 @@
}
/**
- * Return a list of the bonuses handled by this class.
- * @return A list of the bonuses handled by this class.
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
*/
@Override
public String getBonusHandled()
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Vision.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Vision.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Vision.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -39,8 +39,8 @@
"ECHOSENSE", "X-RAY"};
/**
- * Return a list of the bonuses handled by this class.
- * @return A list of the bonuses handled by this class.
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
*/
@Override
public String getBonusHandled()
Modified: Trunk/pcgen/code/src/java/plugin/converter/FavClassConvertPlugin.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/converter/FavClassConvertPlugin.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/converter/FavClassConvertPlugin.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -46,7 +46,7 @@
public String process(TokenProcessEvent tpe)
{
String value = tpe.getValue();
- if (!value.startsWith(Constants.LST_CHOOSE))
+ if (!value.startsWith(Constants.LST_CHOOSE_COLON))
{
// Don't consume, force the default processor to do the work...
return null;
Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/TemplateLst.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/lsttokens/TemplateLst.java 2011-05-29 22:38:42 UTC (rev 15065)
+++ Trunk/pcgen/code/src/java/plugin/lsttokens/TemplateLst.java 2011-05-30 10:02:18 UTC (rev 15066)
@@ -61,16 +61,16 @@
String remaining;
boolean consolidate = false;
boolean specialLegal = false;
- if (value.startsWith(Constants.LST_CHOOSE))
+ if (value.startsWith(Constants.LST_CHOOSE_COLON))
{
lk = ListKey.TEMPLATE_CHOOSE;
- remaining = value.substring(Constants.LST_CHOOSE.length());
+ remaining = value.substring(Constants.LST_CHOOSE_COLON.length());
consolidate = true;
}
- else if (value.startsWith(Constants.LST_ADD_CHOICE))
+ else if (value.startsWith(Constants.LST_ADD_CHOICE_COLON))
{
lk = ListKey.TEMPLATE_ADDCHOICE;
- remaining = value.substring(Constants.LST_ADD_CHOICE.length());
+ remaining = value.substring(Constants.LST_ADD_CHOICE_COLON.length());
}
else
{
@@ -110,7 +110,7 @@
if (consolidate)
{
CDOMCompoundOrReference<PCTemplate> ref = new CDOMCompoundOrReference<PCTemplate>(
- PCTEMPLATE_CLASS, Constants.LST_CHOOSE);
+ PCTEMPLATE_CLASS, Constants.LST_CHOOSE_COLON);
for (CDOMReference<PCTemplate> r : list)
{
ref.addReference(r);
@@ -174,7 +174,7 @@
{
for (CDOMReference<PCTemplate> ref : chadded)
{
- list.add(Constants.LST_CHOOSE
+ list.add(Constants.LST_CHOOSE_COLON
+ ref.getLSTformat(false).replaceAll(",", "\\|"));
}
}
@@ -186,7 +186,7 @@
.getAdded();
if (addedItems != null && !addedItems.isEmpty())
{
- list.add(Constants.LST_ADD_CHOICE
+ list.add(Constants.LST_ADD_CHOICE_COLON
+ ReferenceUtilities.joinLstFormat(addedItems,
Constants.PIPE));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|