|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.qtitools.qti.value.SingleValue
org.qtitools.qti.value.NumberValue
org.qtitools.qti.value.IntegerValue
public class IntegerValue
Implementation of BaseType integer value.
An integer value is A whole number in the range [-2147483648, 2147483647].
Example values: 1, +3, -4.
This class is not mutable and cannot contain NULL value.
Cardinality of this class is always single and BaseType is always integer.
Cardinality,
BaseType,
Serialized Form| Constructor Summary | |
|---|---|
IntegerValue(int value)
Constructs IntegerValue from given int. |
|
IntegerValue(java.lang.String value)
Constructs IntegerValue from given String representation. |
|
IntegerValue(java.lang.String value,
java.lang.Integer radix)
Constructs IntegerValue from given String representation and radix. |
|
| Method Summary | |
|---|---|
double |
doubleValue()
Returns the value of this NumberValue as A double. |
boolean |
equals(java.lang.Object object)
|
BaseType |
getBaseType()
Returns baseType of this value. |
int |
hashCode()
|
int |
intValue()
Returns the value of this NumberValue as A int. |
static int |
parseInteger(java.lang.String value)
Parses the String argument as A int. |
static int |
parseInteger(java.lang.String value,
int radix)
Parses the String argument as A int. |
java.lang.String |
toString()
|
| Methods inherited from class org.qtitools.qti.value.SingleValue |
|---|
getCardinality, isNull |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IntegerValue(int value)
IntegerValue from given int.
value - int
public IntegerValue(java.lang.String value)
throws QTIParseException
IntegerValue from given String representation.
value - String representation of IntegerValue
QTIParseException - if String representation of IntegerValue is not valid
public IntegerValue(java.lang.String value,
java.lang.Integer radix)
IntegerValue from given String representation and radix.
value - String representation of IntegerValueradix - Radix or base to use when interpreting value
QTIParseException - if String representation of IntegerValue is not valid| Method Detail |
|---|
public BaseType getBaseType()
ValueIf value is NULL or record cardinality returns null.
public int intValue()
NumberValueNumberValue as A int.
intValue in class NumberValueNumberValue as A intpublic double doubleValue()
NumberValueNumberValue as A double.
doubleValue in class NumberValueNumberValue as A doublepublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
public static int parseInteger(java.lang.String value)
throws QTIParseException
String argument as A int.
value - String representation of int
int
QTIParseException - if String representation of int is not valid
public static int parseInteger(java.lang.String value,
int radix)
throws QTIParseException
String argument as A int.
value - String representation of intradix - base to use in conversion
int
QTIParseException - if String representation of int is not valid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||