org.pz.platypus
Class CommandParameter

java.lang.Object
  extended by org.pz.platypus.CommandParameter

public class CommandParameter
extends java.lang.Object

Purely a data structure used for returning units information from parsers. It contains, to speak of, no logic. For this reason, there also no unit tests for this class.

Author:
alb

Field Summary
private  float amount
          the number of units
private  int charsParsed
          how many chars were taken up with the number and the units?
private  int errorCode
          if an error occured (unit = ERROR), what kind was it?
private  java.lang.String string
          used only if parameter is a string
private  UnitType unit
          the type of unit.
 
Constructor Summary
CommandParameter()
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Due to its many fields
 float getAmount()
           
 int getCharsParsed()
           
 int getErrorCode()
           
 java.lang.String getString()
           
 UnitType getUnit()
           
 int hashCode()
          If you override equals(), then...
 void setAmount(float amount)
           
 void setCharsParsed(int charsParsed)
           
 void setErrorCode(int errorCode)
           
 void setString(java.lang.String newString)
           
 void setUnit(UnitType unit)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

amount

private float amount
the number of units


unit

private UnitType unit
the type of unit. e.g. POINTS, PIXELS, INCHES, etc.


errorCode

private int errorCode
if an error occured (unit = ERROR), what kind was it?


charsParsed

private int charsParsed
how many chars were taken up with the number and the units?


string

private java.lang.String string
used only if parameter is a string

Constructor Detail

CommandParameter

public CommandParameter()
Method Detail

equals

public boolean equals(java.lang.Object o)
Due to its many fields

Overrides:
equals in class java.lang.Object
Parameters:
o - the command parameter to test equality against
Returns:
true = are equal, false otherwise

hashCode

public int hashCode()
If you override equals(), then...

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

getAmount

public float getAmount()

setAmount

public void setAmount(float amount)

getUnit

public UnitType getUnit()

setUnit

public void setUnit(UnitType unit)

getErrorCode

public int getErrorCode()

setErrorCode

public void setErrorCode(int errorCode)

getCharsParsed

public int getCharsParsed()

setCharsParsed

public void setCharsParsed(int charsParsed)

getString

public java.lang.String getString()

setString

public void setString(java.lang.String newString)


Copyright © 2008-10 Pacific Data Works LLC