xtc.type
Class ClassOrInterfaceT

java.lang.Object
  extended by xtc.tree.Node
      extended by xtc.type.Type
          extended by xtc.type.DerivedT
              extended by xtc.type.ClassOrInterfaceT
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, Locatable
Direct Known Subclasses:
ClassT, InterfaceT

public abstract class ClassOrInterfaceT
extends DerivedT

The superclass of class and interface types.

Version:
$Revision: 1.21 $
Author:
Robert Grimm

Nested Class Summary
 
Nested classes/interfaces inherited from class xtc.type.Type
Type.Tag
 
Field Summary
protected  java.util.List<Type> fields
          The list of fields.
protected  java.util.List<Type> interfaces
          The list of interfaces.
protected  java.util.List<Type> methods
          The list of methods.
protected  java.lang.String qname
          The fully qualfied name.
 
Constructor Summary
ClassOrInterfaceT(Type template, java.lang.String qname, java.util.List<Type> interfaces, java.util.List<Type> fields, java.util.List<Type> methods)
          Create a new class or interface type.
 
Method Summary
 boolean equals(java.lang.Object o)
          Determine whether this type equals the specified object.
 java.util.List<Type> getFields()
          Get the list of fields.
 java.util.List<Type> getInterfaces()
          Get the list of interfaces.
 java.util.List<Type> getMethods()
          Get the list of methods.
 java.lang.String getName()
          Get the unqualified name.
 java.lang.String getQName()
          Get the qualified name.
 java.lang.String getQualifier()
          Get the qualifier for this class' or interface's name.
 int hashCode()
           
 Type seal()
          Seal this type.
 
Methods inherited from class xtc.type.DerivedT
isDerived
 
Methods inherited from class xtc.type.Type
addAttribute, annotate, attribute, attribute, attribute, attributes, cast, checkNotSealed, constant, constant, copy, 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, isVariant, isVoid, isWildcard, isWrapped, language, locate, locate, mark, properties, removeAttribute, removeProperty, resolve, resolve, scope, seal, setLocation, setLocation, setProperty, shape, shape, tag, 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, toVariant, toVoid, toWildcard, toWrapped, trace, wtag
 
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, 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

qname

protected java.lang.String qname
The fully qualfied name.


interfaces

protected java.util.List<Type> interfaces
The list of interfaces.


fields

protected java.util.List<Type> fields
The list of fields.


methods

protected java.util.List<Type> methods
The list of methods.

Constructor Detail

ClassOrInterfaceT

public ClassOrInterfaceT(Type template,
                         java.lang.String qname,
                         java.util.List<Type> interfaces,
                         java.util.List<Type> fields,
                         java.util.List<Type> methods)
Create a new class or interface type.

Parameters:
template - The template whose annotations to copy.
qname - The fully qualified name.
interfaces - The list of interfaces.
fields - The list of fields.
methods - The list of methods.
Method Detail

seal

public Type seal()
Description copied from class: Type
Seal this type. Subclasses that reference other types must override this method and, if the instance is not sealed, first invoke the superclass' version and then seal all referenced types. For example, if a subclass references a single type 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.

Overrides:
seal in class Type
Returns:
This type.
See Also:
Type.seal(List)

getQName

public java.lang.String getQName()
Get the qualified name.

Returns:
The qualified name.

getQualifier

public java.lang.String getQualifier()
Get the qualifier for this class' or interface's name.

Returns:
The qualifier.

getName

public java.lang.String getName()
Get the unqualified name.

Overrides:
getName in class Node
Returns:
The unqualified name.

getInterfaces

public java.util.List<Type> getInterfaces()
Get the list of interfaces.

Returns:
The list of interfaces.

getFields

public java.util.List<Type> getFields()
Get the list of fields.

Returns:
The list of fields.

getMethods

public java.util.List<Type> getMethods()
Get the list of methods.

Returns:
The list of methods.

hashCode

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

equals

public boolean equals(java.lang.Object o)
Determine whether this type equals the specified object. This class or interface equals the specified object if the specified object also is a class or interface with the same name.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object.
Returns:
true if this type equals the object.


Copyright © 2012. All Rights Reserved.