|
||||||||||
| 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.Parameter
public abstract class Parameter
The superclass of all type parameters. When a type is
parameterized, all occurrences of the same parameter should also be
the same instance of a subclass. Furthermore, the type should be
wrapped in a ParameterizedT listing all parameters.
Instantiation of a parameterized type does not require replacing
all parameters, but rather should be implemented by wrapping the
paramterized type in an InstantiatedT listing all
arguments. To support efficient unification, this class implements
union/find operations with path compression through the bind(Type) and lookup() operations.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class xtc.type.Type |
|---|
Type.Tag |
| Constructor Summary | |
|---|---|
Parameter()
Create a new parameter. |
|
Parameter(Type template)
Create a new parameter. |
|
| Method Summary | |
|---|---|
void |
bind(Type type)
Bind this parameter to the specified type. |
boolean |
isParameter()
Determine whether this type is a type parameter. |
Type |
lookup()
Look up this parameter's binding. |
Parameter |
toParameter()
Get this type as a type parameter. |
| 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, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Parameter()
public Parameter(Type template)
template - The type whose annotations to copy.| Method Detail |
|---|
public boolean isParameter()
Type
isParameter in class Typetrue if this type is a parameter.public Parameter toParameter()
Type
toParameter in class Typepublic void bind(Type type)
type - The type.
java.lang.IllegalStateException - Signals that this parameter is
sealed or already bound.public Type lookup()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||