|
From: <nu...@us...> - 2011-05-30 10:53:50
|
Revision: 15067
http://pcgen.svn.sourceforge.net/pcgen/?rev=15067&view=rev
Author: nuance
Date: 2011-05-30 10:53:43 +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/Skill.java
Trunk/pcgen/code/src/java/plugin/bonustokens/SkillPoints.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Slots.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Spell.java
Trunk/pcgen/code/src/java/plugin/bonustokens/SpellCast.java
Trunk/pcgen/code/src/java/plugin/bonustokens/SpellCastMult.java
Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnownMult.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Weapon.java
Trunk/pcgen/code/src/java/plugin/bonustokens/WeaponProf.java
Trunk/pcgen/code/src/java/plugin/bonustokens/WieldCategory.java
Modified: Trunk/pcgen/code/src/java/pcgen/cdom/base/Constants.java
===================================================================
--- Trunk/pcgen/code/src/java/pcgen/cdom/base/Constants.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/pcgen/cdom/base/Constants.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -455,6 +455,9 @@
String LST_SHIELDTYPE_EQUAL = "SHIELDTYPE=";
/** A snippet of List code as a constant. */
+ String LST_STAT_EQUAL = "STAT=";
+
+ /** A snippet of List code as a constant. */
String LST_TYPE_DOT = "TYPE.";
/** A snippet of List code as a constant. */
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Skill.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Skill.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Skill.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -25,32 +25,37 @@
*/
package plugin.bonustokens;
+import pcgen.cdom.base.Constants;
import pcgen.core.bonus.BonusObj;
import pcgen.rules.context.LoadContext;
/**
- * <code>Skill</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:SKILL token.
*/
public final class Skill extends BonusObj
{
- private static final String[] bonusTags = {"LIST", "ALL"};
+ private static final String[] BONUS_TAGS = {"LIST", "ALL"};
+ /**
+ * 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("STAT=") || token.startsWith("TYPE="))
+ if (token.startsWith(Constants.LST_STAT_EQUAL)
+ || token.startsWith(Constants.LST_TYPE_EQUAL))
{
addBonusInfo(token.replace('=', '.'));
}
@@ -62,17 +67,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/SkillPoints.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/SkillPoints.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/SkillPoints.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>SkillPoints</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:SKILLPOINTS token.
*/
public final class SkillPoints 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 "SKILLPOINTS";
}
+ /**
+ * Get by index, an individual skill point 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/Slots.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Slots.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Slots.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -28,32 +28,45 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>Slots</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:SLOTS token.
*/
public final class Slots extends MultiTagBonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{"AMULET", "BELT", "BOOT", "BRACER", "CAPE", "EYEGEAR", "GLOVE",
"HANDS", "HEADGEAR", "LEGS", "ROBE", "RING", "Shield", "SHIRT",
"SUIT", "WEAPON"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "SLOTS";
}
+ /**
+ * Get by index, an individual slot type that may be bonused.
+ * @param tagNumber the index of the slot type.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The slot type.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of slot types that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of slot types.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Spell.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Spell.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Spell.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -28,29 +28,42 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>Spell</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:SPELL token.
*/
public final class Spell extends MultiTagBonusObj
{
- private static final String[] bonusTags = {"DC"};
+ private static final String[] BONUS_TAGS = {"DC"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "SPELL";
}
+ /**
+ * Get by index, an individual spell attribute that may be bonused.
+ * @param tagNumber the index of the spell attribute.
+ * @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 spell attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of spell attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/SpellCast.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/SpellCast.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/SpellCast.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -25,14 +25,13 @@
*/
package plugin.bonustokens;
+import pcgen.cdom.base.Constants;
import pcgen.core.bonus.BonusObj;
import pcgen.core.bonus.util.SpellCastInfo;
import pcgen.rules.context.LoadContext;
/**
- * <code>SpellCast</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:SPELLCAST token.
*/
public final class SpellCast extends BonusObj
{
@@ -42,14 +41,20 @@
* @param token
* @return
*/
+
+ /**
+ * 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)
{
- int idx = token.indexOf(";LEVEL=");
+ int idx = token.indexOf(Constants.LST_SEMI_LEVEL_EQUAL);
if (idx < 0)
{
- idx = token.indexOf(";LEVEL.");
+ idx = token.indexOf(Constants.LST_SEMI_LEVEL_DOT);
}
if (idx < 0)
@@ -57,13 +62,19 @@
return false;
}
- final String level = token.substring(idx + 7);
+ final String level = token.substring(idx + Constants.SUBSTRING_LENGTH_SEVEN);
addBonusInfo(new SpellCastInfo(token.substring(0, idx), level));
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)
{
@@ -72,18 +83,22 @@
if (sci.getType() != null)
{
- sb.append("TYPE.").append(((SpellCastInfo) obj).getType());
+ sb.append(Constants.LST_TYPE_DOT).append(((SpellCastInfo) obj).getType());
}
else if (sci.getPcClassName() != null)
{
- sb.append("CLASS.").append(((SpellCastInfo) obj).getPcClassName());
+ sb.append(Constants.LST_CLASS_DOT).append(((SpellCastInfo) obj).getPcClassName());
}
- sb.append(";LEVEL.").append(((SpellCastInfo) obj).getLevel());
+ sb.append(Constants.LST_SEMI_LEVEL_DOT).append(((SpellCastInfo) obj).getLevel());
return sb.toString();
}
+ /**
+ * 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/SpellCastMult.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/SpellCastMult.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/SpellCastMult.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -25,14 +25,12 @@
*/
package plugin.bonustokens;
+import pcgen.cdom.base.Constants;
import pcgen.core.bonus.BonusObj;
import pcgen.core.bonus.util.SpellCastInfo;
import pcgen.rules.context.LoadContext;
/**
- * <code>SpellCastMult</code>
- *
- * @author Greg Bingleman <by...@ho...>
*/
public final class SpellCastMult extends BonusObj
{
@@ -42,14 +40,20 @@
* @param token
* @return
*/
+
+ /**
+ * 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)
{
- int idx = token.indexOf(";LEVEL=");
+ int idx = token.indexOf(Constants.LST_SEMI_LEVEL_EQUAL);
if (idx < 0)
{
- idx = token.indexOf(";LEVEL.");
+ idx = token.indexOf(Constants.LST_SEMI_LEVEL_DOT);
}
if (idx < 0)
@@ -57,13 +61,19 @@
return false;
}
- final String level = token.substring(idx + 7);
+ final String level = token.substring(idx + Constants.SUBSTRING_LENGTH_SEVEN);
addBonusInfo(new SpellCastInfo(token.substring(0, idx), level));
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)
{
@@ -72,18 +82,22 @@
if (sci.getType() != null)
{
- sb.append("TYPE.").append(((SpellCastInfo) obj).getType());
+ sb.append(Constants.LST_TYPE_DOT).append(((SpellCastInfo) obj).getType());
}
else if (sci.getPcClassName() != null)
{
- sb.append("CLASS.").append(((SpellCastInfo) obj).getPcClassName());
+ sb.append(Constants.LST_CLASS_DOT).append(((SpellCastInfo) obj).getPcClassName());
}
- sb.append(";LEVEL.").append(((SpellCastInfo) obj).getLevel());
+ sb.append(Constants.LST_SEMI_LEVEL_DOT).append(((SpellCastInfo) obj).getLevel());
return sb.toString();
}
+ /**
+ * 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/SpellKnownMult.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnownMult.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnownMult.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -25,6 +25,7 @@
*/
package plugin.bonustokens;
+import pcgen.cdom.base.Constants;
import pcgen.core.bonus.BonusObj;
import pcgen.core.bonus.util.SpellCastInfo;
import pcgen.rules.context.LoadContext;
@@ -42,14 +43,20 @@
* @param token
* @return
*/
+
+ /**
+ * 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)
{
- int idx = token.indexOf(";LEVEL=");
+ int idx = token.indexOf(Constants.LST_SEMI_LEVEL_EQUAL);
if (idx < 0)
{
- idx = token.indexOf(";LEVEL.");
+ idx = token.indexOf(Constants.LST_SEMI_LEVEL_DOT);
}
if (idx < 0)
@@ -57,13 +64,19 @@
return false;
}
- final String level = token.substring(idx + 7);
+ final String level = token.substring(idx + Constants.SUBSTRING_LENGTH_SEVEN);
addBonusInfo(new SpellCastInfo(token.substring(0, idx), level));
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)
{
@@ -72,18 +85,22 @@
if (sci.getType() != null)
{
- sb.append("TYPE.").append(((SpellCastInfo) obj).getType());
+ sb.append(Constants.LST_TYPE_DOT).append(((SpellCastInfo) obj).getType());
}
else if (sci.getPcClassName() != null)
{
- sb.append("CLASS.").append(((SpellCastInfo) obj).getPcClassName());
+ sb.append(Constants.LST_CLASS_DOT).append(((SpellCastInfo) obj).getPcClassName());
}
- sb.append(";LEVEL.").append(((SpellCastInfo) obj).getLevel());
+ sb.append(Constants.LST_SEMI_LEVEL_DOT).append(((SpellCastInfo) obj).getLevel());
return sb.toString();
}
+ /**
+ * 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/Weapon.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Weapon.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Weapon.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -28,31 +28,44 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>Weapon</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:WEAPON token.
*/
public final class Weapon extends MultiTagBonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
new String[]{"ATTACKS", "ATTACKSPROGRESS", "WEAPONBAB", "DAMAGE",
"DAMAGESIZE", "TOHIT", "WIELDCATEGORY"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "WEAPON";
}
+ /**
+ * Get by index, an individual weapon attribute that may be bonused.
+ * @param tagNumber the index of the weapon attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The weapon attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of weapon attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of weapon attributes.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/WeaponProf.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/WeaponProf.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/WeaponProf.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -28,9 +28,7 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>WeaponProf</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:WEAPONPROF= token.
*/
public final class WeaponProf extends MultiTagBonusObj
{
@@ -40,18 +38,33 @@
"TOHIT-SHORTRANGE", "TOHITOVERSIZE", "WEAPONBAB",
"WIELDCATEGORY"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "WEAPONPROF=";
}
+ /**
+ * Get by index, an individual weapon proficiency attribute that may be bonused.
+ * @param tagNumber the index of the weapon proficiency attribute.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The weapon proficiency attribute.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
return bonusTags[tagNumber];
}
+ /**
+ * Get the number of weapon proficiency attributes that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of weapon proficiency attributes.
+ */
@Override
protected int getBonusTagLength()
{
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/WieldCategory.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/WieldCategory.java 2011-05-30 10:02:18 UTC (rev 15066)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/WieldCategory.java 2011-05-30 10:53:43 UTC (rev 15067)
@@ -27,31 +27,43 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>WieldCategory</code>
- *
- * @author Jayme Cox <jay...@us...>
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:WIELDCATEGORY token.
*/
public final class WieldCategory extends MultiTagBonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{"LIGHT", "ONEHANDED", "TWOHANDED"};
+ /**
+ * Return the bonus tag handled by this class.
+ * @return The bonus handled by this class.
+ */
@Override
public String getBonusHandled()
{
return "WIELDCATEGORY";
}
+ /**
+ * Get by index, an individual wield category that may be bonused.
+ * @param tagNumber the index of the wield category.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The wield category.
+ */
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
+ /**
+ * Get the number of wield categories that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of wield categories.
+ */
@Override
protected int getBonusTagLength()
{
- return bonusTags.length;
+ return BONUS_TAGS.length;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|