|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectplatypus.CommandValue
public class CommandValue
Class for processing commands with numeric parameters. It accepts the number/value substring, and validates the number and the units; it then converts the units to points.
| Field Summary | |
|---|---|
private float |
amount
amount in units |
private int |
lineNumber
the line number in the input text where this was value was set/used |
private PlatyConst.unit |
units
the type of units (lines, pts, inches, centimeters) |
| Constructor Summary | |
|---|---|
CommandValue()
Creates a generic CommandValue and sets it to default values |
|
CommandValue(float inAmount)
Creates a CommandValue and sets it to inAmount. |
|
CommandValue(java.lang.String s,
java.lang.String commandName)
Constructor that is passed a value+unit substring and creates a CommandValue object containing fields for value and units. |
|
| Method Summary | |
|---|---|
java.lang.String |
dump()
Dumps content of data items in user-friendly format. |
float |
getAmount()
return the amount of units |
int |
getLineNumber()
return the line number where the command was found |
PlatyConst.unit |
getUnits()
return the number of units |
void |
setAmountInPoints(float points)
|
java.lang.String |
stateError(java.lang.String s)
Prints some kind of error message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private float amount
private PlatyConst.unit units
private int lineNumber
| Constructor Detail |
|---|
public CommandValue()
public CommandValue(float inAmount)
inAmount - the value of the units.
public CommandValue(java.lang.String s,
java.lang.String commandName)
s - the unit and value substring that needs to be parsedcommandName - the command containing s. Used for error message only| Method Detail |
|---|
public java.lang.String stateError(java.lang.String s)
s - the command string originally passed to the constructor
public java.lang.String dump()
public PlatyConst.unit getUnits()
public float getAmount()
public int getLineNumber()
public void setAmountInPoints(float points)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||