|
||||||||||
| 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.TupleT
public class TupleT
A tuple type. Tuples may be either anonymous, without a name, or named. For named tuples, this class provides accessors to the full name and the simple name, which is the full name without any qualifier.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class xtc.type.Type |
|---|
Type.Tag |
| Constructor Summary | |
|---|---|
TupleT()
Create a new incomplete and anonymous tuple type. |
|
TupleT(java.util.List<Type> types)
Create a new anonymous tuple type. |
|
TupleT(java.lang.String name)
Create a new incomplete tuple type. |
|
TupleT(java.lang.String name,
java.util.List<Type> types)
Create a new tuple type. |
|
TupleT(java.lang.String name,
Type type)
Create a new tuple type. |
|
TupleT(Type template,
java.lang.String name,
java.util.List<Type> types)
Create a new tuple type. |
|
| Method Summary | |
|---|---|
TupleT |
copy()
Create a deep copy of this type. |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getName()
Get this tuple's name. |
java.lang.String |
getSimpleName()
Get this tuple's simple name. |
java.util.List<Type> |
getTypes()
Get the element types. |
int |
hashCode()
|
boolean |
hasName()
Determine whether this tuple has a name. |
boolean |
hasName(java.lang.String name)
Determine whether this tuple has the specified name. |
boolean |
hasSimpleName(java.lang.String name)
Determine whether this tuple has the specified simple name. |
boolean |
isTuple()
Determine whether this type is an tuple. |
Type |
seal()
Seal this type. |
void |
setTypes(java.util.List<Type> types)
Set the element types. |
Type.Tag |
tag()
Get this type's tag. |
TupleT |
toTuple()
Get this type as an tuple. |
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, getNode, getProperty, getString, getStringProperty, getTokenText, 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 TupleT()
public TupleT(java.util.List<Type> types)
types - The types.public TupleT(java.lang.String name)
name - The name.
public TupleT(java.lang.String name,
Type type)
name - The name.type - The only element type.
public TupleT(java.lang.String name,
java.util.List<Type> types)
name - The name.types - The element types.
public TupleT(Type template,
java.lang.String name,
java.util.List<Type> types)
template - The type whose annotations to copy.name - The name.types - The element types.| 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 TupleT copy()
Type
copy in class Typepublic Type.Tag tag()
Type
tag in class TypeType.wtag()public boolean isTuple()
Type
isTuple in class Typetrue if this type is an tuple.public TupleT toTuple()
Type
toTuple in class Typepublic boolean hasName()
true if this tuple has a name.public boolean hasName(java.lang.String name)
hasName in class Nodename - The name.
true if this tuple has the name.public boolean hasSimpleName(java.lang.String name)
name - The simple name.
true if this tuple has the simple name.public java.lang.String getName()
getName in class Nodenull if this tuple is anonymous.public java.lang.String getSimpleName()
null if this tuple is
anonymous.public java.util.List<Type> getTypes()
public void setTypes(java.util.List<Type> types)
types - The new element types.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 | |||||||||