|
||||||||||
| 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.DerivedT
xtc.type.ArrayT
public class ArrayT
An array type. An array can either be of fixed or variable length,
with a length of -1 indicating that a fixed length
array is incomplete.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class xtc.type.Type |
|---|
Type.Tag |
| Constructor Summary | |
|---|---|
ArrayT(Type type)
Create a new, incomplete array type. |
|
ArrayT(Type type,
boolean varlength)
Create a new variable length array. |
|
ArrayT(Type type,
long length)
Create a new array type. |
|
ArrayT(Type template,
Type type,
boolean varlength,
long length)
Create a new array type. |
|
| Method Summary | |
|---|---|
ArrayT |
copy()
Create a deep copy of this type. |
boolean |
equals(java.lang.Object o)
|
long |
getLength()
Get the length. |
Type |
getType()
Get the element type. |
int |
hashCode()
|
boolean |
hasLength()
Determine whether this array has a length. |
boolean |
isArray()
Determine whether this type is an array. |
boolean |
isVarLength()
Determine whether the array is of variable length. |
Type |
seal()
Seal this type. |
void |
setLength(long length)
Set the length. |
void |
setVarLength(boolean varlength)
Set the variable length flag. |
Type.Tag |
tag()
Get this type's tag. |
ArrayT |
toArray()
Get this type as an array. |
void |
write(java.lang.Appendable out)
Write a human readable representation to the specified appendable. |
| Methods inherited from class xtc.type.DerivedT |
|---|
isDerived |
| 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, toString, toToken |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayT(Type type)
type - The element type.
public ArrayT(Type type,
boolean varlength)
type - The element type.varlength - The flag for whether this array is of variable
length, which must be true.
public ArrayT(Type type,
long length)
type - The element type.length - The length.
public ArrayT(Type template,
Type type,
boolean varlength,
long length)
template - The type whose annotations to copy.type - The element type.varlength - The flag for whether this array is variable.length - The length.| Method Detail |
|---|
public Type seal()
Typetype, the corresponding overridden method reads:
public Type seal() {
if (! isSealed()) {
super.seal();
type.seal();
}
return this;
}
First testing whether a type is sealed and then invoking the
superclass' seal() method avoids infinite recursions
for mutually recursive types.
seal in class TypeType.seal(List)public ArrayT copy()
Type
copy in class Typepublic Type.Tag tag()
Type
tag in class TypeType.wtag()public boolean isArray()
Type
isArray in class Typetrue if this type is an array.public ArrayT toArray()
Type
toArray in class Typepublic Type getType()
public boolean isVarLength()
true if this array is variable length.public void setVarLength(boolean varlength)
varlength - The variable length flag.
java.lang.IllegalStateException - Signals that this type is sealed.public boolean hasLength()
true if this array has a length.public long getLength()
-1 if this type is either of
variable length or incomplete.public void setLength(long length)
length - The length.
java.lang.IllegalStateException - Signals that this type is sealed.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||