|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hava.engine.HValue
public class HValue
A value that may be assigned to a Hava variable at run-time. It is implemented as a wrapper on what might be a standard Java class (Integer, Double, Boolean) or a custom Hava class (not publicly visible).
Field Summary | |
---|---|
static HValue |
BLANK
A built-in token. |
static HValue |
BOOLEAN
A built-in token, returned by getType(). |
static HValue |
EMPTYLIST
A built-in value. |
static HValue |
ERROR
A built-in token. |
static HValue |
FALSE
A built-in value. |
static HValue |
IGNORE
A built-in token. |
static HValue |
INTEGER
A built-in token, returned by getType(). |
static HValue |
LIST
A built-in token, returned by getType(). |
static HValue |
ONE
A built-in value. |
static HValue |
REAL
A built-in token, returned by getType(). |
static HValue |
STRUCTURE
A built-in token, returned by getType(). |
static HValue |
TOKEN
A built-in token, returned by getType(). |
static HValue |
TRUE
A built-in value. |
static HValue |
TWO
A built-in value. |
static HValue |
ZERO
A built-in value. |
Constructor Summary | |
---|---|
HValue(java.lang.Boolean dvalue)
Create an HValue wrapper for the given boolean. |
|
HValue(java.lang.Double dvalue)
Create an HValue wrapper for the given double. |
|
HValue(HValue[] a)
Create an HValue wrapper for the given list. |
|
HValue(java.lang.Integer ivalue)
Create an HValue wrapper for the given integer. |
Method Summary | |
---|---|
boolean |
booleanValue()
Returns this value as a boolean (run-time failure if it is not boolean). |
int |
compareDefinitionRank(HValue v)
Used by report generator to determine the sequence in which value types were defined. |
double |
doubleValue()
Returns this value as a double (run-time failure if it is not numerical). |
boolean |
equals(java.lang.Object x)
|
HValue |
getElement(int i)
If compound, returns the i-th element. |
int |
getNumElements()
If compound, returns the number of elements it contains. |
HParameters |
getParameters()
Returns the definition of the indexes or fields of this value (if it is an index or a structure). |
HValue |
getType()
Returns the type of this value, as a Hava token instance. |
int |
hashCode()
|
int |
intValue()
Returns this value as an int (run-time failure if it is not numerical). |
boolean |
isBoolean()
Returns true if this value is a boolean. |
boolean |
isCompound()
Returns true if this value is a list, an index or a structure. |
boolean |
isDouble()
Returns true if this value is a double. |
boolean |
isIndex()
Returns true if this value is an index. |
boolean |
isInteger()
Returns true if this value is an integer. |
boolean |
isList()
Returns true if this value is a list. |
boolean |
isNumerical()
Returns true if this value is a number (integer or double). |
boolean |
isStructure()
Returns true if this value is a structure. |
boolean |
isToken()
Returns true if this value is a token. |
HValue |
structField(java.lang.String fieldName)
Returns the value of the field of given name (struct value only). |
java.lang.String |
toString()
Provides a representation of this value in the same format that appears in the demo report. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final HValue BLANK
public static final HValue BOOLEAN
public static final HValue EMPTYLIST
public static final HValue ERROR
public static final HValue FALSE
public static final HValue IGNORE
public static final HValue INTEGER
public static final HValue LIST
public static final HValue ONE
public static final HValue REAL
public static final HValue STRUCTURE
public static final HValue TOKEN
public static final HValue TRUE
public static final HValue TWO
public static final HValue ZERO
Constructor Detail |
---|
public HValue(java.lang.Boolean dvalue)
public HValue(java.lang.Double dvalue)
public HValue(HValue[] a)
public HValue(java.lang.Integer ivalue)
Method Detail |
---|
public boolean booleanValue()
public int compareDefinitionRank(HValue v)
Meaningful only values with defined types: token, structure, reference, import or doc comment. In other words, not meaningful for integer, real, boolean or list types.
Returns 1 if the type of this value was defined before the type of the argument v, -1 if the opposite is true, or 0 if they have the same definition.
public double doubleValue()
public boolean equals(java.lang.Object x)
equals
in class java.lang.Object
public HValue getElement(int i)
public int getNumElements()
public HParameters getParameters()
public HValue getType()
public int hashCode()
hashCode
in class java.lang.Object
public int intValue()
public boolean isBoolean()
public boolean isCompound()
public boolean isDouble()
public boolean isIndex()
public boolean isInteger()
public boolean isList()
public boolean isNumerical()
public boolean isStructure()
public boolean isToken()
public HValue structField(java.lang.String fieldName)
public 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 |