|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pz.platypus.parsers.CommandParameterParser
public class CommandParameterParser
Handles all the various command-parameter parsing tasks. All public classes are static.
Constructor Summary | |
---|---|
CommandParameterParser()
|
Method Summary | |
---|---|
static int |
countBraces(char[] input,
int start)
Count the number of opening braces in a parameter |
static java.lang.String |
extractNumericString(char[] content,
int parsePoint)
Extracts the numeric value from a specific point in a char array. |
static java.lang.String |
extractStringInsideBraces(char[] input,
int start)
Extracts the string parameter enclosed in matching opening and closing braces |
static CommandParameter |
extractStringParam(char[] input,
int parsePoint)
Static method that extracts a string parameter. |
static UnitType |
extractUnitType(char[] input,
int parsePoint)
Gets the unit type. |
static CommandParameter |
extractUnitValue(char[] input,
int parsePoint)
Parses a substring that contains a quantity. |
static java.lang.String |
makeBraces(char braceChar,
int howMany)
Returns a string of braces (that is { or }, depending on the char passed to it) for the length specified. |
static UnitType |
unitAbbrevToUnitType(char[] input,
int parsePoint)
Convert the abbreviation used for the unit into a unit-type (an enum in PlatyConst) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandParameterParser()
Method Detail |
---|
public static CommandParameter extractUnitValue(char[] input, int parsePoint)
input
- char[] that contains a numeric quantityparsePoint
- the point in input where the numeric quantity to isLineComment begins
public static java.lang.String extractNumericString(char[] content, int parsePoint)
content
- the char[] containing the valueparsePoint
- where the value begins in content
public static UnitType extractUnitType(char[] input, int parsePoint)
input
- the characters that contain the unit typeparsePoint
- where the unit type begins in input
public static UnitType unitAbbrevToUnitType(char[] input, int parsePoint)
input
- characters containing the unit abbreviationparsePoint
- where the unit abbreviation begins
public static CommandParameter extractStringParam(char[] input, int parsePoint)
input
- the text we're parsing for the parameterparsePoint
- where the parameter begins
public static java.lang.String extractStringInsideBraces(char[] input, int start)
input
- the text in which the braces and parameter are locatedstart
- where the first opening brace begins
public static int countBraces(char[] input, int start)
input
- the chars containing the opening bracesstart
- where the opening braces start
public static java.lang.String makeBraces(char braceChar, int howMany)
braceChar
- is '{' for opening brace or '}' for closing bracehowMany
- how many braces to put in the string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |