|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Node
xtc.type.Type
xtc.type.NumberT
public abstract class NumberT
The superclass of all number types.
| Nested Class Summary | |
|---|---|
static class |
NumberT.Kind
The number kind. |
| Nested classes/interfaces inherited from class xtc.type.Type |
|---|
Type.Tag |
| Field Summary | |
|---|---|
static IntegerT |
BYTE
The canonical signed byte type. |
static IntegerT |
CHAR
The canonical char type. |
static FloatT |
DOUBLE
The canonical double type. |
static FloatT |
DOUBLE_COMPLEX
The canonical double complex type. |
static FloatT |
FLOAT
The canonical float type. |
static FloatT |
FLOAT_COMPLEX
The canonical float complex type. |
static IntegerT |
INT
The canonical int type. |
protected NumberT.Kind |
kind
The kind. |
static IntegerT |
LONG
The canonical signed long type. |
static FloatT |
LONG_DOUBLE
The canonical long double type. |
static FloatT |
LONG_DOUBLE_COMPLEX
The canonical long double complex type. |
static IntegerT |
LONG_LONG
The canonical signed long long type. |
static IntegerT |
S_CHAR
The canonical signed char type. |
static IntegerT |
S_INT
The canonical signed int type. |
static IntegerT |
SHORT
The canonical short type. |
static IntegerT |
U_CHAR
The canonical unsigned char type. |
static IntegerT |
U_INT
The cannical unsigned int type. |
static IntegerT |
U_LONG
The canonical unsigned long type. |
static IntegerT |
U_LONG_LONG
The canonical unsigned long long type. |
static IntegerT |
U_SHORT
The canonical unsigned short type. |
| Constructor Summary | |
|---|---|
NumberT(NumberT.Kind kind)
Create a new number type. |
|
NumberT(Type template,
NumberT.Kind kind)
Create a new number type. |
|
| Method Summary | |
|---|---|
static boolean |
equal(NumberT.Kind k1,
NumberT.Kind k2)
Determine whether the specified kinds equal each other. |
static boolean |
equalIgnoringSign(NumberT.Kind k1,
NumberT.Kind k2)
Determine whether the specified kinds equal each other, modulo their signs. |
boolean |
equals(java.lang.Object o)
Determine whether this type equals the specified object. |
NumberT.Kind |
getKind()
Get the kind. |
int |
hashCode()
|
boolean |
hasKind(NumberT.Kind kind)
Determine whether this number has the specified kind. |
boolean |
isNumber()
Determine whether this type is a number. |
boolean |
isSigned()
Determine whether this number is signed. |
NumberT |
toNumber()
Get this type as a number. |
java.lang.String |
toString()
Return a human readable representation of this node. |
void |
write(java.lang.Appendable out)
Write a human readable representation to the specified appendable. |
| Methods inherited from class xtc.tree.Node |
|---|
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getName, getNode, getProperty, getString, getStringProperty, getTokenText, hasName, hasProperty, hasTraversal, indexOf, isAnnotation, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, remove, set, size, strip, toAnnotation, toList, toToken |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final IntegerT BYTE
public static final IntegerT CHAR
public static final IntegerT S_CHAR
public static final IntegerT U_CHAR
public static final IntegerT SHORT
public static final IntegerT U_SHORT
public static final IntegerT INT
public static final IntegerT S_INT
public static final IntegerT U_INT
public static final IntegerT LONG
public static final IntegerT U_LONG
public static final IntegerT LONG_LONG
public static final IntegerT U_LONG_LONG
public static final FloatT FLOAT
public static final FloatT DOUBLE
public static final FloatT LONG_DOUBLE
public static final FloatT FLOAT_COMPLEX
public static final FloatT DOUBLE_COMPLEX
public static final FloatT LONG_DOUBLE_COMPLEX
protected final NumberT.Kind kind
| Constructor Detail |
|---|
public NumberT(NumberT.Kind kind)
kind - The kind.
public NumberT(Type template,
NumberT.Kind kind)
template - The type whose annotations to copy.kind - The kind.| Method Detail |
|---|
public boolean isNumber()
Type
isNumber in class Typetrue if this type is a number.public NumberT toNumber()
Type
toNumber in class Typepublic boolean hasKind(NumberT.Kind kind)
equal(Kind,Kind) to perform the kind
comparison.
kind - The kind.
true if this number has the specified kind.public NumberT.Kind getKind()
public boolean isSigned()
true if this number is signed.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
int and signed int kinds.
equals in class java.lang.Objecto - The object.
true if this type equals the object.
public void write(java.lang.Appendable out)
throws java.io.IOException
NodeObject.toString().
write in class Nodeout - The appendable.
java.io.IOException - Signals an I/O error.public java.lang.String toString()
NodeNode.write(Appendable).
toString in class Node
public static boolean equal(NumberT.Kind k1,
NumberT.Kind k2)
k1 - The first kind.k2 - The second kind.
true if the kinds are equal.
public static boolean equalIgnoringSign(NumberT.Kind k1,
NumberT.Kind k2)
k1 - The first kind.k2 - The second kind.
true if the kinds are equal modulo their
signs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||