17.4.2. The IValue Interface

Objects that implements the interface IValue represents values from Kick Assembler like numbers, strings and booleans. For instance, the arguments given to a macro are given as IValue objects. The IValue interface contains the following methods to extract information from the value:

Table 17.2. IValue Interface

Method Description
int getInt(); Gets an integer from the value if possible, otherwise it will give an error message.
Double getDouble(); Gets a double from the value if possible, otherwise it will give an error message.
String getString(); Gets a string from the value if possible, otherwise it will give an error message.
Boolean getBoolean(); Gets a Boolean from the value if possible, otherwise it will give an error message.
List<IValue> getList(); Gets at list of values if possible, otherwise it will give an error message. The list implements size(), get(i), isEmpty() and iterator().
Boolean hasIntRepresentation(); Tells if you can get an integer from the value. Every number value can produce an integer. 3.2 will produce 3).
boolean hasDoubleRepresentation(); Tells if you can get a double from the value.
boolean hasStringRepresentation(); Tells if you can get a string from the value.
boolean hasBooleanRepresentation(); Tells if you can get a boolean from the value.
boolean hasListRepresentation(); Tells if you can get a list from the value.