public class VariantT extends DerivedT
| Constructor and Description |
|---|
VariantT(java.lang.String name)
Create a new incomplete variant type.
|
VariantT(java.lang.String name,
boolean polymorphic,
java.util.List<TupleT> tuples)
Create a new variant type.
|
VariantT(java.lang.String name,
java.util.List<TupleT> tuples)
Create a new variant type.
|
VariantT(Type template,
java.lang.String name,
boolean polymorphic,
java.util.List<TupleT> tuples)
Create a new variant type.
|
| Modifier and Type | Method and Description |
|---|---|
VariantT |
copy()
Create a deep copy of this type.
|
boolean |
equals(java.lang.Object o)
Determine whether this variant equals the specified object.
|
java.lang.String |
getName()
Get this variant's name.
|
java.lang.String |
getQualifier()
Get this variant's qualifier.
|
java.lang.String |
getSimpleName()
Get this variant's simple name.
|
java.util.List<TupleT> |
getTuples()
Get this variant's tuples.
|
int |
hashCode() |
boolean |
isPolymorphic()
Determine whether the variant is polymorphic.
|
boolean |
isVariant()
Determine whether this type is an variant.
|
Type |
lookup(java.lang.String name)
Look up the tuple with the specified name.
|
Type |
lookupSimple(java.lang.String name)
Look up the tuple with the specified simple name.
|
Type |
seal()
Seal this type.
|
void |
setTuples(java.util.List<TupleT> tuples)
Set this variant's tuples.
|
Type.Tag |
tag()
Get this type's tag.
|
VariantT |
toVariant()
Get this type as an variant.
|
void |
write(java.lang.Appendable out)
Write a human readable representation to the specified
appendable.
|
addAttribute, annotate, attribute, attribute, attribute, attributes, cast, checkNotSealed, constant, constant, copy, deannotate, getAttribute, getAttribute, getConstant, getConstant, getLanguage, getLanguage, getLocation, getLocation, getScope, getScope, getShape, getShape, hasAlias, hasAnnotated, hasAttribute, hasAttribute, hasAttribute, hasAttribute, hasAttributes, hasConstant, hasConstant, hasEnum, hasEnumerator, hasError, hasInstantiated, hasLanguage, hasLanguage, hasLocation, hasLocation, hasParameterized, hasScope, hasScope, hasShape, hasShape, hasStructOrUnion, hasTag, hasTagged, hasVariable, hasWTag, isAlias, isAnnotated, isArray, isBoolean, isClass, isConcrete, isEnum, isEnumerator, isError, isFloat, isFunction, isInstantiated, isInteger, isInterface, isInternal, isInternalParameter, isLabel, isMethod, isNamedParameter, isNumber, isPackage, isParameter, isParameterized, isPointer, isSealed, isStruct, isTuple, isUnion, isUnit, isVariable, isVoid, isWildcard, isWrapped, language, locate, locate, mark, properties, removeAttribute, removeProperty, resolve, resolve, scope, seal, setLocation, setLocation, setProperty, shape, shape, toAlias, toAnnotated, toArray, toBoolean, toClass, toEnum, toEnumerator, toFloat, toFunction, toInstantiated, toInteger, toInterface, toInternal, toInternalParameter, toLabel, toMethod, toNamedParameter, toNumber, toPackage, toParameter, toParameterized, toPointer, toStruct, toStructOrUnion, toTagged, toTuple, toUnion, toUnit, toVariable, toVoid, toWildcard, toWrapped, trace, wtagadd, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getNode, getProperty, getString, getStringProperty, getTokenText, hasName, hasProperty, hasTraversal, indexOf, isAnnotation, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, remove, set, size, strip, toAnnotation, toList, toString, toTokenpublic VariantT(java.lang.String name)
name - The name.java.lang.NullPointerException - Signals that the name is null.public VariantT(java.lang.String name,
java.util.List<TupleT> tuples)
name - The name.tuples - The tuples.java.lang.NullPointerException - Signals that the name is null.public VariantT(java.lang.String name,
boolean polymorphic,
java.util.List<TupleT> tuples)
name - The name.polymorphic - The flag for polymorphic variants.tuples - The tuples.java.lang.NullPointerException - Signals that the name is null for a
monomorphic variant.public VariantT(Type template, java.lang.String name, boolean polymorphic, java.util.List<TupleT> tuples)
template - The type whose annotations to copy.name - The name.polymorphic - The flag for polymorphic variants.tuples - The tuples.java.lang.NullPointerException - Signals that the name is null for a
monomorphic variant.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 VariantT copy()
Typepublic Type.Tag tag()
Typetag in class TypeType.wtag()public boolean isVariant()
Typepublic VariantT toVariant()
Typepublic java.lang.String getName()
public java.lang.String getQualifier()
null if this variant does
not have a qualified name.public java.lang.String getSimpleName()
null if this variant is
anonymous.public boolean isPolymorphic()
true if the variant is polymorphic.public Type lookup(java.lang.String name)
name - The name.ErrorT.TYPE if this variant has no
such tuple.public Type lookupSimple(java.lang.String name)
name - The simple name.ErrorT.TYPE if this
variant has no such tuple.public java.util.List<TupleT> getTuples()
public void setTuples(java.util.List<TupleT> tuples)
tuples - The new list of tuples.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - The object.true if this variant equals the object.public void write(java.lang.Appendable out)
throws java.io.IOException
NodeObject.toString().Copyright © 2014. All Rights Reserved.