public abstract class Type extends Node
isName() and toName()
methods to replace instanceof tests and casts, respectively. For
each wrapped type, this class additionally provides a
hasName() method, which identifies instances of
the wrapped type even if they are wrapped inside another (wrapped)
type. In other words, invocations of hasName()
are forwarded across wrapped types while invocations of
isName() only apply to the outermost type
object. For wrapped types, invocations of
toName() are also forwarded across (other)
wrapped types.
As an example, consider an int type wrapped in an annotated
type and an alias type:
Type i = NumberT.INT;
Type j = new AnnotatedT(i);
Type k = new AliasT("alias", j);
Then the following method invocations have the following results:
k.isAlias() ⇒ true k.hasAlias() ⇒ true k.toAlias() ⇒ k k.isAnnotated() ⇒ false k.hasAnnotated() ⇒ true k.toAnnotated() ⇒ j k.isInteger() ⇒ false k.toInteger() ⇒ errorThe
resolve() method can be used to strip any wrapped
types:
Type r = k.resolve(); r.isAlias() ⇒ false r.isAnnotated() ⇒ false r.isInteger() ⇒ true r.toInteger() ⇒ iThe
Type.Tag enumeration also identifies particular types.
A type's tag can be accessed through tag(), which is
forwarded across wrapped types, and through wtag(), which
is not forwarded across wrapped types. As a result,
tag() identifies basic types independent of whether
they are wrapped or not, while wtag() always
identifies the outermost type:
k.tag() ⇒ Tag.INTEGER k.wtag() ⇒ Tag.ALIAS i.tag() ⇒ Tag.INTEGER i.tag() ⇒ Tag.INTEGEREach type can have one or more of the following annotations:
Location.Language tag.String.Constant.Reference. Only
lvalues can have a shape.Attribute
values.| Modifier and Type | Class and Description |
|---|---|
static class |
Type.Tag
A type's tag.
|
| Constructor and Description |
|---|
Type()
Create a new type.
|
Type(Type template)
Create a new type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(Attribute att)
Add the specified attribute.
|
Type |
annotate()
Annotate this type.
|
Type |
attribute(Attribute att)
Annotate this type with the specified attribute.
|
Type |
attribute(java.util.List<Attribute> attributes)
Annotate this type with the specified attributes.
|
Type |
attribute(Type template)
Annotate this type with the specified type's attributes.
|
java.util.List<Attribute> |
attributes()
Get this type's attributes.
|
static Type |
cast(java.lang.Object type)
Cast the specified object to a type.
|
protected void |
checkNotSealed()
Ensure that this type is not sealed.
|
Type |
constant(boolean value)
Set this type's constant.
|
Type |
constant(java.lang.Object value)
Set this type's constant.
|
abstract Type |
copy()
Create a deep copy of this type.
|
static <T extends Type> |
copy(java.util.List<T> types)
Copy the specified list of types.
|
Type |
deannotate()
Deannotate this type.
|
Attribute |
getAttribute(java.lang.String name)
Get the attribute with the specified name.
|
Attribute |
getAttribute(java.lang.String name,
boolean forward)
Get the attribute with the specified name.
|
Constant |
getConstant()
Get this type's or any wrapped type's constant.
|
Constant |
getConstant(boolean forward)
Get this type's or any wrapped type's constant.
|
Language |
getLanguage()
Get this type's or any wrapped type's language.
|
Language |
getLanguage(boolean forward)
Get this type's or any wrapped type's language.
|
Location |
getLocation()
Get this type's or any wrapped type's location.
|
Location |
getLocation(boolean forward)
Get this type's or any wrapped type's location.
|
java.lang.String |
getScope()
Get this type's or any wrapped type's scope.
|
java.lang.String |
getScope(boolean forward)
Get this type's or any wrapped type's scope.
|
Reference |
getShape()
Get this type's or any wrapped type's shape.
|
Reference |
getShape(boolean forward)
Get this type's or any wrapped type's shape.
|
boolean |
hasAlias()
Determine whether this type contains an alias.
|
boolean |
hasAnnotated()
Determine whether this type has an annotated type.
|
boolean |
hasAttribute(Attribute att)
Determine whether this type or any wrapped type has the specified
attribute.
|
boolean |
hasAttribute(Attribute att,
boolean forward)
Determine whether this type or any wrapped type has the specified
attribute.
|
boolean |
hasAttribute(java.lang.String name)
Determine whether this type has an attribute with the specified
name.
|
boolean |
hasAttribute(java.lang.String name,
boolean forward)
Determine whether this type has an attribute with the specified
name.
|
boolean |
hasAttributes()
Determine whether this type has any attributes.
|
boolean |
hasConstant()
Determine whether this type or any wrapped type has a constant.
|
boolean |
hasConstant(boolean forward)
Determine whether this type or any wrapped type has a constant.
|
boolean |
hasEnum()
Determine whether this type contains an enum.
|
boolean |
hasEnumerator()
Determine whether this type contains an enumerator.
|
boolean |
hasError()
Determine whether this type has an error.
|
boolean |
hasInstantiated()
Determine whether this type has an instantiated type.
|
boolean |
hasLanguage()
Determine whether this type or any wrapped type has a language.
|
boolean |
hasLanguage(boolean forward)
Determine whether this type or any wrapped type has a language.
|
boolean |
hasLocation()
Determine whether this type or any wrapped type has a location.
|
boolean |
hasLocation(boolean forward)
Determine whether this type or any wrapped type has a location.
|
boolean |
hasParameterized()
Determine whether this type has a parameterized type.
|
boolean |
hasScope()
Determine whether this type or any wrapped type has a scope.
|
boolean |
hasScope(boolean forward)
Determine whether this type or any wrapped type has a scope.
|
boolean |
hasShape()
Determine whether this type or any wrapped type has a shape.
|
boolean |
hasShape(boolean forward)
Determine whether this type or any wrapped type has a shape.
|
boolean |
hasStructOrUnion()
Determine whether this type contains a struct or union.
|
boolean |
hasTag(Type.Tag tag)
Determine whether this type has the specified tag.
|
boolean |
hasTagged()
Determine whether this type is tagged.
|
boolean |
hasVariable()
Determine whether this type contains a variable.
|
boolean |
hasWTag(Type.Tag tag)
Determine whether this wrapped type has the specified tag.
|
boolean |
isAlias()
Determine whether this type is an alias.
|
boolean |
isAnnotated()
Determine whether this type is annotated.
|
boolean |
isArray()
Determine whether this type is an array.
|
boolean |
isBoolean()
Determine whether this type is a boolean.
|
boolean |
isClass()
Determine whether this type is a class.
|
boolean |
isConcrete()
Determine whether this type is concrete.
|
boolean |
isDerived()
Determine whether this type is derived.
|
boolean |
isEnum()
Determine whether this type is an enum.
|
boolean |
isEnumerator()
Determine whether this type is an enumerator.
|
boolean |
isError()
Determine whether this type is an error.
|
boolean |
isFloat()
Determine whether this type is a float.
|
boolean |
isFunction()
Determine whether this type is a function.
|
boolean |
isInstantiated()
Determine whether this type is instantiated.
|
boolean |
isInteger()
Determine whether this type is an integer.
|
boolean |
isInterface()
Determine whether this type is an interface.
|
boolean |
isInternal()
Determine whether this type is internal.
|
boolean |
isInternalParameter()
Determine whether this type is an internal parameter.
|
boolean |
isLabel()
Determine whether this type is a label.
|
boolean |
isMethod()
Determine whether this type is a method.
|
boolean |
isNamedParameter()
Determine whether this type is a named parameter.
|
boolean |
isNumber()
Determine whether this type is a number.
|
boolean |
isPackage()
Determine whether this type is a package.
|
boolean |
isParameter()
Determine whether this type is a type parameter.
|
boolean |
isParameterized()
Determine whether this type is parameterized.
|
boolean |
isPointer()
Determine whether this type is a pointer.
|
boolean |
isSealed()
Determine whether this type is sealed.
|
boolean |
isStruct()
Determine whether this type is a struct.
|
boolean |
isTuple()
Determine whether this type is an tuple.
|
boolean |
isUnion()
Determine whether this type is a union.
|
boolean |
isUnit()
Determine whether this type is the unit type.
|
boolean |
isVariable()
Determine whether this type is a variable.
|
boolean |
isVariant()
Determine whether this type is an variant.
|
boolean |
isVoid()
Determine whether this type is void.
|
boolean |
isWildcard()
Determine whether this type is a wildcard.
|
boolean |
isWrapped()
Determine whether this type is wrapped.
|
Type |
language(Language language)
Set this type's language.
|
Type |
locate(Locatable locatable)
Set this type's location.
|
Type |
locate(Location location)
Set this type's location.
|
void |
mark(Node node)
Mark the specified node as having this type.
|
java.util.Set<java.lang.String> |
properties()
Get the set of property names.
|
boolean |
removeAttribute(Attribute att)
Remove the specified attribute.
|
java.lang.Object |
removeProperty(java.lang.String name)
Remove a property.
|
Type |
resolve()
Resolve this type.
|
static Type |
resolve(java.lang.Object type)
Resolve the specified object as type.
|
Type |
scope(java.lang.String scope)
Set this type's scope.
|
Type |
seal()
Seal this type.
|
static <T extends Type> |
seal(java.util.List<T> types)
Seal the specified list of types.
|
void |
setLocation(Locatable locatable)
Set this object's location to the specified locatable's location.
|
void |
setLocation(Location location)
Set this object's location.
|
java.lang.Object |
setProperty(java.lang.String name,
java.lang.Object value)
Set the value of a property.
|
Type |
shape(boolean isStatic,
java.lang.String name)
Set this type's shape to a variable reference with the specified
name.
|
Type |
shape(Reference shape)
Set this type's shape.
|
abstract Type.Tag |
tag()
Get this type's tag.
|
AliasT |
toAlias()
Get this type as an alias.
|
AnnotatedT |
toAnnotated()
Get this type as an annotated type.
|
ArrayT |
toArray()
Get this type as an array.
|
BooleanT |
toBoolean()
Get this type as a boolean.
|
ClassT |
toClass()
Get this type as a class.
|
EnumT |
toEnum()
Get this type as an enum.
|
EnumeratorT |
toEnumerator()
Get this type as an enumerator.
|
FloatT |
toFloat()
Get this type as a float.
|
FunctionT |
toFunction()
Get this type as a function.
|
InstantiatedT |
toInstantiated()
Get this type as an instantiated type.
|
IntegerT |
toInteger()
Get this type as an integer.
|
InterfaceT |
toInterface()
Get this type as an interface.
|
InternalT |
toInternal()
Get this type as an internal type.
|
InternalParameter |
toInternalParameter()
Get this type as an internal parameter.
|
LabelT |
toLabel()
Get this type as a label.
|
MethodT |
toMethod()
Get this type as a method.
|
NamedParameter |
toNamedParameter()
Get this type as a named parameter.
|
NumberT |
toNumber()
Get this type as a number.
|
PackageT |
toPackage()
Get this type as a package.
|
Parameter |
toParameter()
Get this type as a type parameter.
|
ParameterizedT |
toParameterized()
Get this type as a parameterized type.
|
PointerT |
toPointer()
Get this type as a pointer.
|
StructT |
toStruct()
Get this type as a struct.
|
StructOrUnionT |
toStructOrUnion()
Get this type as a struct or union.
|
Tagged |
toTagged()
Get this type as a tagged type.
|
TupleT |
toTuple()
Get this type as an tuple.
|
UnionT |
toUnion()
Get this type as a union.
|
UnitT |
toUnit()
Get this type as a unit type.
|
VariableT |
toVariable()
Get this type as a variable.
|
VariantT |
toVariant()
Get this type as an variant.
|
VoidT |
toVoid()
Get this type as a void type.
|
Wildcard |
toWildcard()
Get this type as a wildcard.
|
WrappedT |
toWrapped()
Get this type as a wrapped type.
|
void |
trace(Runtime runtime)
Trace this type to the runtime's console.
|
Type.Tag |
wtag()
Get this wrapped type's tag.
|
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, writepublic Type()
public Type(Type template)
template - The type whose annotations to copy.public abstract Type copy()
public boolean isSealed()
true if this type is sealed.public Type seal()
type, 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(List)protected void checkNotSealed()
java.lang.IllegalStateException - Signals that this type is sealed.public Type annotate()
AnnotatedT.public Type deannotate()
AnnotatedT from this type.public java.lang.Object setProperty(java.lang.String name,
java.lang.Object value)
NodesetProperty in class Nodename - The property name.value - The new property value.null if the
property didn't have a value.public java.lang.Object removeProperty(java.lang.String name)
NoderemoveProperty in class Nodename - The property name.null if the
property didn't have a value.public java.util.Set<java.lang.String> properties()
Nodeproperties in class Nodepublic boolean hasLocation()
t is equivalent to:
t.hasLocation(true)
hasLocation in interface LocatablehasLocation in class Nodetrue if this type or any wrapped type has a
location.hasLocation(boolean)public boolean hasLocation(boolean forward)
forward - The flag for whether to forward this method across
wrapped types.true if this type or any wrapped type has a
location.public Location getLocation()
t is equivalent to:
t.getLocation(true)
getLocation in interface LocatablegetLocation in class Nodenull if this type or any
wrapped type does not have a location.getLocation(boolean)public Location getLocation(boolean forward)
forward - The flag for whether to forward this method across
wrapped types.null if this type or any
wrapped type does not have a location.public Type locate(Location location)
location - The location.java.lang.IllegalStateException - Signals that this type is sealed.public Type locate(Locatable locatable)
locatable - The locatable.java.lang.IllegalStateException - Signals that this type is sealed.public void setLocation(Location location)
LocatablesetLocation in interface LocatablesetLocation in class Nodelocation - This object's location.public void setLocation(Locatable locatable)
LocatablesetLocation in interface LocatablesetLocation in class Nodelocatable - The locatable object.public boolean hasLanguage()
t is equivalent to:
t.hasLanguage(true)
true if this type or any wrapped type has a
language.hasLanguage(boolean)public boolean hasLanguage(boolean forward)
forward - The flag for whether to forward this method across
wrapped types.true if this type or any wrapped type has a
language.public Language getLanguage()
t is equivalent to:
t.getLanguage(true)
null if this type or any
wrapped type does not have a language.getLanguage(boolean)public Language getLanguage(boolean forward)
forward - The flag for whether to forward this method across
wrapped types.null if this type or any
wrapped type does not have a language.public Type language(Language language)
language - The language.java.lang.IllegalStateException - Signals that this type is sealed.public boolean hasScope()
t is equivalent to:
t.hasScope(true)
true if this type or any wrapped type has a
scope.hasScope(boolean)public boolean hasScope(boolean forward)
forward - The flag for whether to forward this method across
wrapped types.true if this type or any wrapped type has a
scope.public java.lang.String getScope()
t is equivalent to:
t.getScope(true)
null if this type or any
wrapped type does not have a scope.getScope(boolean)public java.lang.String getScope(boolean forward)
forward - The flag for whether to forward this method across
wrapped types.null if this type or any
wrapped type does not have a scope.public Type scope(java.lang.String scope)
scope - The scope.java.lang.IllegalStateException - Signals that this type is sealed.public boolean hasConstant()
t is equivalent to:
t.hasConstant(true)
true if this type has a constant.hasConstant(boolean)public boolean hasConstant(boolean forward)
forward - The flag for whether to forward this method across
wrapped types.true if this type or any wrapped type has a
constant.public Constant getConstant()
t is equivalent to:
t.getConstant(true)
null if this type or any
wrapped type does not have a constant.getConstant(boolean)public Constant getConstant(boolean forward)
forward - The flag for whether to forward this method across
wrapped types.null if this type or any
wrapped type does not have a constant.public Type constant(boolean value)
value - The value.java.lang.IllegalStateException - Signals that this type is sealed.constant(Object)public Type constant(java.lang.Object value)
value - The value.java.lang.IllegalArgumentException - Signals an invalid value.java.lang.IllegalStateException - Signals that this type is sealed.public boolean hasShape()
t is equivalent to:
t.hasShape(true)
true if this type or any wrapped type has a
shape.hasShape(boolean)public boolean hasShape(boolean forward)
forward - The flag for whether to forward this method across
wrapped types.true if this type or any wrapped type has a
shape.public Reference getShape()
t is equivalent to:
t.getShape(true)
null if this type or any
wrapped type does not have a shape.getShape(boolean)public Reference getShape(boolean forward)
forward - The flag for whether to forward this method across
wrapped types.null if this type or any
wrapped type does not have a shape.public Type shape(boolean isStatic, java.lang.String name)
isStatic - The flag for whether the variable is static.name - The variable name.java.lang.IllegalStateException - Signals that this type is sealed.StaticReference,
DynamicReference,
shape(Reference)public Type shape(Reference shape)
shape - The shape represented as a reference.java.lang.IllegalStateException - Signals that this type is sealed.public boolean hasAttributes()
true if this type has any attributes.public java.util.List<Attribute> attributes()
public boolean hasAttribute(Attribute att)
t is
equivalent to:
t.hasAttribute(att, true)
att - The attribute.true if this type or any wrapped type has
the attribute.hasAttribute(Attribute,boolean)public boolean hasAttribute(Attribute att, boolean forward)
att - The attribute.forward - The flag for whether to forward this method across
wrapped types.true if this type or any wrapped type has
the attribute.public boolean hasAttribute(java.lang.String name)
t is equivalent
to:
null != t.getAttribute(name, true)
name - The name.true if this type or any wrapped type has
an attribute with the specified name.getAttribute(String,boolean)public boolean hasAttribute(java.lang.String name,
boolean forward)
t is equivalent
to:
null != t.getAttribute(name, forward)
name - The name.forward - The flag for whether to forward this method across
wrapped types.true if this type or any wrapped type has
an attribute with the specified name.public Attribute getAttribute(java.lang.String name)
t is equivalent to:
t.getAttribute(name, true)
name - The name.null if this
type or any wrapped type does not have such an attribute.getAttribute(String,boolean)public Attribute getAttribute(java.lang.String name, boolean forward)
name - The name.forward - The flag for whether to forward this method across
wrapped types.null if this
or any wrapped type does not have such an attribute.public void addAttribute(Attribute att)
attribute(Attribute), attribute(List), or attribute(Type).att - The new attribute.java.lang.IllegalStateException - Signals that this type is sealed.public boolean removeAttribute(Attribute att)
att - The attribute.true if this type had the specified
attribute.java.lang.IllegalStateException - Signals that this type is sealed.public Type attribute(Attribute att)
att - The attribute.java.lang.IllegalStateException - Signals that this type is sealed.public Type attribute(java.util.List<Attribute> attributes)
attributes - The attributes.java.lang.IllegalStateException - Signals that this type is sealed.attribute(Attribute)public Type attribute(Type template)
template - The type whose annotations to copy.java.lang.IllegalStateException - Signals that this type is sealed.public void mark(Node node)
type property to this type.node - The node.java.lang.IllegalArgumentException - Signals that the node already
has a type property.public boolean hasTag(Type.Tag tag)
t is equivalent to:
tag == t.tag()
tag - The tag.true if this type has the specified tag.tag()public abstract Type.Tag tag()
wtag()public boolean hasWTag(Type.Tag tag)
t is
equivalent to:
tag == wtag()
tag - The tag.true if this wrapped type has the specified
tag.wtag()public Type.Tag wtag()
tag()public boolean isError()
true if this type is internal.public boolean hasError()
error type even if it is wrapped. Calling this
method on type t is equivalent to:
Type.Tag.Error == tag()
true if this type has an error.tag()public boolean isParameter()
true if this type is a parameter.public Parameter toParameter()
java.lang.ClassCastException - Signals that this type is not a
parameter.public boolean isNamedParameter()
true if this type is a named parameter.public NamedParameter toNamedParameter()
java.lang.ClassCastException - Signals that this type is not a
named parameter.public boolean isInternalParameter()
true if this type is an internal parameter.public InternalParameter toInternalParameter()
java.lang.ClassCastException - Signals that this type is not an
internal parameter.public boolean isWildcard()
true if this type is a wildcard.public Wildcard toWildcard()
java.lang.ClassCastException - Signals that this type is not a
wildcard.public boolean isVoid()
true if this type is void.public VoidT toVoid()
java.lang.ClassCastException - Signals that this type is not a void
type.public boolean isUnit()
true if this type is the unit type.public UnitT toUnit()
java.lang.ClassCastException - Signals that this type is not a unit
type.public boolean isBoolean()
true if this type is a boolean.public BooleanT toBoolean()
java.lang.ClassCastException - Signals that this type is a not a
boolean.public boolean isNumber()
true if this type is a number.public NumberT toNumber()
java.lang.ClassCastException - Signals that this type is not a
number.public boolean isInteger()
true if this type is an integer.public IntegerT toInteger()
java.lang.ClassCastException - Signals that this type is not an
integer.public boolean isFloat()
true if this type is a float.public FloatT toFloat()
java.lang.ClassCastException - Signals that this type is not a
float.public boolean isInternal()
true if this type is internal.public InternalT toInternal()
java.lang.ClassCastException - Signals that this type is not an
internal type.public boolean isLabel()
true if this type is a label.public LabelT toLabel()
java.lang.ClassCastException - Signals that this type is not a
label.public boolean isPackage()
true if this type is a package.public PackageT toPackage()
java.lang.ClassCastException - Signals that this type is not a
package.public boolean isDerived()
true if this type is derived.public boolean isPointer()
true if this type is a pointer.public PointerT toPointer()
java.lang.ClassCastException - Signals that this type is not a
pointer.public boolean isArray()
true if this type is an array.public ArrayT toArray()
java.lang.ClassCastException - Signals that this type is not an
array.public boolean hasStructOrUnion()
true if this type contains a struct or
union.public StructOrUnionT toStructOrUnion()
java.lang.ClassCastException - Signals that this type is not a struct
or union.public boolean isStruct()
true if this type is a struct.public StructT toStruct()
java.lang.ClassCastException - Signas that this type is not a
struct.public boolean isUnion()
true if this type is a union.public UnionT toUnion()
java.lang.ClassCastException - Signals that this type is not a
union.public boolean isFunction()
true if this type is a function.public FunctionT toFunction()
java.lang.ClassCastException - Signals that this type is not a
function.public boolean isMethod()
true if this type is a method.public MethodT toMethod()
java.lang.ClassCastException - Signals that this type is not a
method.public boolean isClass()
true if this type is a class.public ClassT toClass()
java.lang.ClassCastException - Signals that this type is not a class.public boolean isInterface()
true if this type is an interface.public InterfaceT toInterface()
java.lang.ClassCastException - Signals that this type is not an
interface.public boolean isTuple()
true if this type is an tuple.public TupleT toTuple()
java.lang.ClassCastException - Signals that this type is not an tuple.public boolean isVariant()
true if this type is an variant.public VariantT toVariant()
java.lang.ClassCastException - Signals that this type is not an variant.public boolean isWrapped()
true if this type is wrapped.public WrappedT toWrapped()
java.lang.ClassCastException - Signals that this type is not wrapped.public boolean isAnnotated()
true if this type is annotated.public boolean hasAnnotated()
true if this type has an annotated type.public AnnotatedT toAnnotated()
java.lang.ClassCastException - Signas that this type is not an
annotated type.public boolean isAlias()
true if this type is an alias.public boolean hasAlias()
true if this type contains an alias.public AliasT toAlias()
java.lang.ClassCastException - Signals that this type is not an
alias.public boolean isEnum()
true if this type is an enum.public boolean hasEnum()
true if this type contains an enum.public EnumT toEnum()
java.lang.ClassCastException - Signals that this type is not an enum.public boolean isEnumerator()
true if this type is an enumerator.public boolean hasEnumerator()
true if this type contains an enumerator.public EnumeratorT toEnumerator()
java.lang.ClassCastException - Signals that this type is not an
enumerator.public boolean isInstantiated()
true if this type is instantiated.public boolean hasInstantiated()
true if this type has an instantiated type.public InstantiatedT toInstantiated()
java.lang.ClassCastException - Signas that this type is not an
instantiated type.public boolean isParameterized()
true if this type is parameterized.public boolean hasParameterized()
true if this type has a parameterized type.public ParameterizedT toParameterized()
java.lang.ClassCastException - Signas that this type is not a
parameterized type.public boolean isVariable()
true if this type is a variable.public boolean hasVariable()
hasVariable in class Nodetrue if this type contains a variable.Node.hasTraversal()public VariableT toVariable()
java.lang.ClassCastException - Signals that this type does not
contain a variable.public boolean hasTagged()
true if this type is tagged.public Tagged toTagged()
java.lang.ClassCastException - Signals that this type is not
tagged.hasTagged()public boolean isConcrete()
true if this type is not parameterized or is both
parameterized and instantiated.true if this type is concrete.public Type resolve()
public void trace(Runtime runtime)
TypePrinter; it is useful for debugging.runtime - The runtime.public static Type cast(java.lang.Object type)
type - The type as an object.java.lang.ClassCastException - Signals that the specified object is
not a type.public static Type resolve(java.lang.Object type)
type - The type.java.lang.ClassCastException - Signals that the specified object is
not a type.public static <T extends Type> java.util.List<T> copy(java.util.List<T> types)
types - The list of types.public static <T extends Type> java.util.List<T> seal(java.util.List<T> types)
types - The list of types.Copyright © 2014. All Rights Reserved.