xtc.type
Class Wildcard

java.lang.Object
  extended by xtc.tree.Node
      extended by xtc.type.Type
          extended by xtc.type.Parameter
              extended by xtc.type.Wildcard
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, Locatable

public class Wildcard
extends Parameter

A type wildcard.

Version:
$Revision: 1.3 $
Author:
Robert Grimm

Nested Class Summary
 
Nested classes/interfaces inherited from class xtc.type.Type
Type.Tag
 
Field Summary
static Wildcard TYPE
          The canonical wildcard.
 
Constructor Summary
Wildcard()
          Create a new wildcard.
Wildcard(Type template)
          Create a new wildcard.
 
Method Summary
 void bind(Type type)
          Bind this wildcard.
 Wildcard copy()
          Create a deep copy of this type.
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 boolean isWildcard()
          Determine whether this type is a wildcard.
 Type.Tag tag()
          Get this type's tag.
 Wildcard toWildcard()
          Get this type as a wildcard.
 
Methods inherited from class xtc.type.Parameter
isParameter, lookup, toParameter
 
Methods inherited from class xtc.type.Type
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, isDerived, isEnum, isEnumerator, isError, isFloat, isFunction, isInstantiated, isInteger, isInterface, isInternal, isInternalParameter, isLabel, isMethod, isNamedParameter, isNumber, isPackage, isParameterized, isPointer, isSealed, isStruct, isTuple, isUnion, isUnit, isVariable, isVariant, isVoid, isWrapped, language, locate, locate, mark, properties, removeAttribute, removeProperty, resolve, resolve, scope, seal, 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, toParameterized, toPointer, toStruct, toStructOrUnion, toTagged, toTuple, toUnion, toUnit, toVariable, toVariant, toVoid, toWrapped, trace, wtag
 
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, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final Wildcard TYPE
The canonical wildcard.

Constructor Detail

Wildcard

public Wildcard()
Create a new wildcard.


Wildcard

public Wildcard(Type template)
Create a new wildcard.

Parameters:
template - The type whose annotations to copy.
Method Detail

copy

public Wildcard copy()
Description copied from class: Type
Create a deep copy of this type. The resulting type is not sealed.

Specified by:
copy in class Type
Returns:
A deep copy of this type.

tag

public Type.Tag tag()
Description copied from class: Type
Get this type's tag. Invocations to this method are forwarded across wrapped types.

Specified by:
tag in class Type
Returns:
This type's tag.
See Also:
Type.wtag()

isWildcard

public boolean isWildcard()
Description copied from class: Type
Determine whether this type is a wildcard.

Overrides:
isWildcard in class Type
Returns:
true if this type is a wildcard.

toWildcard

public Wildcard toWildcard()
Description copied from class: Type
Get this type as a wildcard.

Overrides:
toWildcard in class Type
Returns:
This type as a wildcard.

bind

public void bind(Type type)
Bind this wildcard. Wildcards cannot be bound.

Overrides:
bind in class Parameter
Parameters:
type - The type.
Throws:
java.lang.IllegalStateException - Signals that wildcards cannot be bound.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2012. All Rights Reserved.