|
From: <nu...@us...> - 2011-05-29 22:14:40
|
Revision: 15064
http://pcgen.svn.sourceforge.net/pcgen/?rev=15064&view=rev
Author: nuance
Date: 2011-05-29 22:14:34 +0000 (Sun, 29 May 2011)
Log Message:
-----------
CheckStyle updates.
Modified Paths:
--------------
Trunk/pcgen/code/src/java/pcgen/cdom/base/Constants.java
Trunk/pcgen/code/src/java/pcgen/rules/persistence/TokenLibrary.java
Trunk/pcgen/code/src/java/plugin/bonustokens/AbilityPool.java
Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnown.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Stat.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Var.java
Trunk/pcgen/code/src/java/plugin/bonustokens/Vision.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 21:17:18 UTC (rev 15063)
+++ Trunk/pcgen/code/src/java/pcgen/cdom/base/Constants.java 2011-05-29 22:14:34 UTC (rev 15064)
@@ -416,13 +416,19 @@
String LST_DOT_CLEAR_DOT = ".CLEAR.";
/** A snippet of List code as a constant. */
+ String LST_SEMI_LEVEL_DOT = ";LEVEL.";
+
+ /** A snippet of List code as a constant. */
+ String LST_SEMI_LEVEL_EQUAL = ";LEVEL=";
+
+ /** A snippet of List code as a constant. */
String LST_BASE = "BASE.";
/** A snippet of List code as a constant. */
- String LST_CAST_OLD = "CAST.";
+ String LST_CAST_DOT = "CAST.";
/** A snippet of List code as a constant. */
- String LST_CAST = "CAST=";
+ String LST_CAST_EQUAL = "CAST=";
/** A snippet of List code as a constant. */
String LST_TYPE_OLD = "TYPE.";
@@ -604,9 +610,12 @@
int ARBITRARY_END_SKILL_INDEX = 999;
/**
- * The length of both the LST_TYPE and LST_TYPE_OLD constants. */
+ * The length of various LST constants that need to stripped from the front of a string during parsing. */
int SUBSTRING_LENGTH_FIVE = 5;
+ /**
+ * The length of various LST constants that need to stripped from the front of a string during parsing. */
+ int SUBSTRING_LENGTH_SEVEN = 7;
/**
* The default for whether to print the weapon proficiencies.
Modified: Trunk/pcgen/code/src/java/pcgen/rules/persistence/TokenLibrary.java
===================================================================
--- Trunk/pcgen/code/src/java/pcgen/rules/persistence/TokenLibrary.java 2011-05-29 21:17:18 UTC (rev 15063)
+++ Trunk/pcgen/code/src/java/pcgen/rules/persistence/TokenLibrary.java 2011-05-29 22:14:34 UTC (rev 15064)
@@ -458,7 +458,9 @@
* @throws InstantiationException
* @throws IllegalAccessException
*/
- public static boolean addBonusClass(Class bonusClass, String bonusName) throws InstantiationException, IllegalAccessException {
+ public static boolean addBonusClass(Class bonusClass,
+ String bonusName) throws InstantiationException, IllegalAccessException
+ {
if (BonusObj.class.isAssignableFrom(bonusClass))
{
final BonusObj bonusObj = (BonusObj) bonusClass.newInstance();
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/AbilityPool.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/AbilityPool.java 2011-05-29 21:17:18 UTC (rev 15063)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/AbilityPool.java 2011-05-29 22:14:34 UTC (rev 15064)
@@ -28,17 +28,16 @@
import pcgen.util.Logging;
/**
- * Handles <code>BONUS:ABILITYPOOL|<ability category>|<number>
- * </code> token
+ * Handles the BONUS:ABILITYPOOL token.
*
* @author boomer70 <boo...@ya...>
- *
- * @since 5.11.1
*/
public final class AbilityPool 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)
@@ -52,7 +51,10 @@
}
/**
+ * 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)
@@ -61,7 +63,8 @@
}
/**
- * @see pcgen.core.bonus.BonusObj#getBonusesHandled()
+ * Return a list of the bonuses handled by this class.
+ * @return A list of the bonuses handled by this class.
*/
@Override
public String getBonusHandled()
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnown.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnown.java 2011-05-29 21:17:18 UTC (rev 15063)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/SpellKnown.java 2011-05-29 22:14:34 UTC (rev 15064)
@@ -25,31 +25,30 @@
*/
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>SpellKnown</code>
- *
- * @author Greg Bingleman <by...@ho...>
+ * Handles the BONUS:SPELLKNOWN token.
*/
public final class SpellKnown extends BonusObj
{
/**
- * CLASS=<classname OR Any>;LEVEL=<level>
- * TYPE=<type>;LEVEL=<level>
- * @param token
- * @return TRUE or FALSE
+ * Parse the bonus token.
+ * @param token The token to parse.
+ * @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 +56,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)
{
@@ -84,6 +89,10 @@
return sb.toString();
}
+ /**
+ * Return a list of the bonuses handled by this class.
+ * @return A list of the bonuses handled by this class.
+ */
@Override
public String getBonusHandled()
{
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Stat.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Stat.java 2011-05-29 21:17:18 UTC (rev 15063)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Stat.java 2011-05-29 22:14:34 UTC (rev 15064)
@@ -52,8 +52,8 @@
}
}
- if (token.startsWith(Constants.LST_CAST)
- || token.startsWith(Constants.LST_CAST_OLD))
+ if (token.startsWith(Constants.LST_CAST_EQUAL)
+ || token.startsWith(Constants.LST_CAST_DOT))
{
PCStat stat = context.ref.getAbbreviatedObject(
PCStat.class,
Modified: Trunk/pcgen/code/src/java/plugin/bonustokens/Var.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/bonustokens/Var.java 2011-05-29 21:17:18 UTC (rev 15063)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Var.java 2011-05-29 22:14:34 UTC (rev 15064)
@@ -36,7 +36,9 @@
public final class Var 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)
@@ -47,7 +49,10 @@
}
/**
+ * 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)
@@ -56,7 +61,8 @@
}
/**
- * @see pcgen.core.bonus.BonusObj#getBonusesHandled()
+ * Return a list of the bonuses handled by this class.
+ * @return A list of the bonuses 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 21:17:18 UTC (rev 15063)
+++ Trunk/pcgen/code/src/java/plugin/bonustokens/Vision.java 2011-05-29 22:14:34 UTC (rev 15064)
@@ -28,18 +28,19 @@
import pcgen.core.bonus.MultiTagBonusObj;
/**
- * <code>Vision</code> deals with bonuses to a character's vision
+ * <code>Vision</code> deals with bonuses to a character's vision.
*
* @author Greg Bingleman <by...@ho...>
*/
public final class Vision extends MultiTagBonusObj
{
- private static final String[] bonusTags =
+ private static final String[] BONUS_TAGS =
{"NORMAL", "LOW-LIGHT", "DARKVISION", "BLINDSIGHT", "TREMORSENSE",
"ECHOSENSE", "X-RAY"};
/**
- * @see pcgen.core.bonus.BonusObj#getBonusesHandled()
+ * Return a list of the bonuses handled by this class.
+ * @return A list of the bonuses handled by this class.
*/
@Override
public String getBonusHandled()
@@ -48,20 +49,25 @@
}
/**
+ * Get by index, an individual type of vision that may be bonused.
+ * @param tagNumber the index of the vision type.
* @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The type of vision.
*/
@Override
protected String getBonusTag(final int tagNumber)
{
- return bonusTags[tagNumber];
+ return BONUS_TAGS[tagNumber];
}
/**
- * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTagLength()
+ * Get the number of types of vision that may be bonused.
+ * @see pcgen.core.bonus.MultiTagBonusObj#getBonusTag(int)
+ * @return The number of vision types.
*/
@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.
|