|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.billpringle.utils.wrputils.WrpValidateCsv.Variable
public class WrpValidateCsv.Variable
Inner class for variable.
This class represents variables during the execution of the validation rules. All variables must be declared, although the declarations can appear after it is referenced. A variable exists throughout the execution stage. The map command can be used to define a relationship between a CSV field and a variable. Each time a new record is processed, the CSV fields are copied to the mapped variables. Non-mapped variables retain their values until they are changed. Because of this, variables can retain their values across different CSV records, which means you can accumulate totals for the entire execution phase.
To increase efficiency, the index into variables for a referenced variable is stored in the rule structure so that a search for the variable is not required during run time.
Field Summary | |
---|---|
boolean |
boolVal
value of variable, if boolean |
java.lang.Boolean |
fld
flag indicating variable is mapped to a field |
float |
fltVal
value of variable, if float |
int |
intVal
value of variable, if integer |
java.lang.String |
name
variable name |
java.lang.String |
strVal
value of variable, if string |
int |
type
variable type (TYPE_something) |
Constructor Summary | |
---|---|
WrpValidateCsv.Variable()
Default constructor |
Method Summary | |
---|---|
float |
getFltVal()
Get the floating point value of this variable |
int |
getIntVal()
Get the integer value of this variable |
java.lang.String |
getName()
Get the name of this variable |
java.lang.String |
getStrVal()
Get the string value of this variable |
int |
getType()
Get the data type of this variable |
java.lang.Object |
getVal()
Get the current value of the variable. |
boolean |
isBoolVal()
Get the boolean value for this variable |
boolean |
isField()
Determines if the current variable is mapped to a CSV field. |
boolean |
set(WrpValidateCsv.Variable v)
Set the value to that of the specified variable. |
void |
setBoolVal(boolean boolVal)
Set the boolean value of this variable |
void |
setField(java.lang.Boolean b)
Specify if the variable is mapped to a CSV field. |
void |
setFltVal(float fltVal)
Set the floating point variable of this variable |
void |
setIntVal(int intVal)
Set the integer variable of this variable |
void |
setName(java.lang.String name)
Set the name of this variable |
void |
setStrVal(java.lang.String strVal)
Set the string value of this variable |
void |
setType(int type)
Set the data type of this variable |
void |
setType(java.lang.String ftype)
Set the data type of this variable |
boolean |
setVal(java.lang.String val)
Set the value based on the type of variable |
java.lang.String |
toString()
Build string representation of Variable, including the values and locations |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.lang.String name
public int type
public java.lang.Boolean fld
public java.lang.String strVal
public int intVal
public float fltVal
public boolean boolVal
Constructor Detail |
---|
public WrpValidateCsv.Variable()
Method Detail |
---|
public boolean setVal(java.lang.String val) throws java.lang.NumberFormatException
val
- the new value of the variable
java.lang.NumberFormatException
- if the value doesn't match the data typepublic boolean set(WrpValidateCsv.Variable v)
v
- the Variable containing the new value
public java.lang.Object getVal()
The data type that is returned depends on the type of the variable.
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to setpublic int getType()
public void setType(int type)
type
- the type to setpublic void setType(java.lang.String ftype)
ftype
- the name of the data type to be setpublic java.lang.String getStrVal()
public void setStrVal(java.lang.String strVal)
strVal
- the strVal to setpublic int getIntVal()
public void setIntVal(int intVal)
intVal
- the intVal to setpublic float getFltVal()
public void setFltVal(float fltVal)
fltVal
- the fltVal to setpublic boolean isBoolVal()
public void setBoolVal(boolean boolVal)
boolVal
- the boolVal to setpublic boolean isField()
public void setField(java.lang.Boolean b)
b
- true if the variable is mapped; false otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |