|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.exoftware.exactor.Parameter
A parameter to a command. Provides convenience methods to obtain the numeric or boolean value of the parameter.
Constructor Summary | |
Parameter(java.lang.String s)
Create a new Parameter with the specified value. |
Method Summary | |
boolean |
booleanValue()
Returns the boolean value of the parameter. |
double |
doubleValue()
Returns the double value of the parameter. |
Command |
getCommand()
Returns the command that owns this parameter. |
int |
intValue()
Returns the int value of the parameter. |
boolean |
isNumeric()
Check whether the parameter value represents a number. |
void |
setCommand(Command c)
Set the owning command for this parameter. |
java.lang.String |
stringValue()
Returns the string value of the parameter, with any substitutions replaced. |
java.lang.String |
toString()
Returns a string representation of the paremeter. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Parameter(java.lang.String s)
s
represents an integer or double value the
numeric equivalent can be obtained through the convenience methods,
intValue
and doubleValue
. If s
equals, ignoring case, the string 'true' the boolean equivalent can be
obtained through the convenience method, booleanValue
. In
all cases the string value of the parameter can be obtained via stringValue
or toString
.
s
- the value of the parameter.intValue()
,
doubleValue()
,
booleanValue()
Method Detail |
public java.lang.String stringValue()
[xxx]
, where xxx
represents a key in either the script or execution set context for the command owning this parameter.
For example, as the execution set context contains all of the System properties, the following code
would display Windows XP
on a Windows XP machine.;
Parameter p = new Parameter( "[os.name]" );
p.setCommand( myCommand );
System.out.println( p.stringValue() );
public java.lang.String toString()
public boolean isNumeric()
true
if the parameter represents a number, otherwise
false
.public int intValue() throws java.lang.NumberFormatException
Integer.parseInt
.
java.lang.NumberFormatException
- if the parameter value is not a number.Integer.parseInt(String)
public double doubleValue() throws java.lang.NumberFormatException
Double.parseDouble
.
java.lang.NumberFormatException
- if the parameter value is not a number.Double.parseDouble(String)
public boolean booleanValue()
Boolean.valueOf
.
true
if the parameter value is equal, ignoring
case, to the String 'true', otherwise false
.Boolean.valueOf(String)
public void setCommand(Command c) throws java.lang.RuntimeException
c
- the command tnat owns this parameter.
java.lang.RuntimeException
- if the supplied command is null
.public Command getCommand()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |