Java Doc for Type.java in  » Parser » Rats-Parser-Generators » xtc » type » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Parser » Rats Parser Generators » xtc.type 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   xtc.tree.Node
      xtc.type.Type

All known Subclasses:   xtc.type.VoidT,  xtc.type.InternalT,  xtc.type.UnitT,  xtc.type.LabelT,  xtc.type.DerivedT,  xtc.type.Parameter,  xtc.type.NumberT,  xtc.type.PackageT,  xtc.type.ErrorT,  xtc.type.WrappedT,  xtc.type.BooleanT,
Type
abstract public class Type extends Node (Code)
The superclass of all types.

The class hierarchy for types distinguishes basic from wrapped types, with wrapped types providing additional information for basic types. For each basic type, this class provides 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()      ⇒ error
 
The Type.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()      ⇒ i
 

The Tag enumeration also identifies particular types. A type's tag can be accessed through Type.tag() , which is forwarded across wrapped types, and through Type.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.INTEGER
 

Each type can have one or more of the following annotations:

  • Its source location represented as a Location .
  • Its source language represented as a Language tag.
  • Its scope represented as a String .
  • Its constant value represented as a Constant .
  • Its memory shape represented as a Reference . Only lvalues can have a shape.
  • Its attributes represented as a list of Attribute values.
For each kind of annotation, this class defines tester, getter, and setter methods. The tester and getter methods come in two versions, one that is forwarded across wrapped types and one that uses a boolean parameter to control forwarding.
author:
   Robert Grimm
version:
   $Revision: 1.110 $

Inner Class :public static enum Tag

Field Summary
 List<Attribute>attributes
     This type's attributes.
 Constantconstant
     This type's constant value.
 Languagelanguage
     This type's language.
 Stringscope
     This type's scope.
 booleansealed
     The flag for whether this type is sealed.
 Referenceshape
     This type's shape.

Constructor Summary
public  Type()
     Create a new type.
public  Type(Type template)
     Create a new type.

Method Summary
public  voidaddAttribute(Attribute att)
     Add the specified attribute.
public  Typeannotate()
     Annotate this type.
public  Typeattribute(Attribute att)
     Annotate this type with the specified attribute.
public  Typeattribute(List<Attribute> attributes)
     Annotate this type with the specified attributes.
See Also:   Type.attribute(Attribute)
Parameters:
  attributes - The attributes.
public  Typeattribute(Type template)
     Annotate this type with the specified type's attributes.
Parameters:
  template - The type whose annotations to copy.
public  List<Attribute>attributes()
     Get this type's attributes.
public static  Typecast(Object type)
     Cast the specified object to a type.
Parameters:
  type - The type as an object.
protected  voidcheckNotSealed()
     Ensure that this type is not sealed.
public  Typeconstant(boolean value)
     Set this type's constant.
See Also:   Type.constant(Object)
Parameters:
  value - The value.
public  Typeconstant(Object value)
     Set this type's constant.
Parameters:
  value - The value.
abstract public  Typecopy()
     Create a deep copy of this type.
public static  List<T>copy(List<T> types)
     Copy the specified list of types.
public  Typedeannotate()
     Deannotate this type.
public  AttributegetAttribute(String name)
     Get the attribute with the specified name.
public  AttributegetAttribute(String name, boolean forward)
     Get the attribute with the specified name.
Parameters:
  name - The name.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  ConstantgetConstant()
     Get this type's or any wrapped type's constant.
public  ConstantgetConstant(boolean forward)
     Get this type's or any wrapped type's constant.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  LanguagegetLanguage()
     Get this type's or any wrapped type's language.
public  LanguagegetLanguage(boolean forward)
     Get this type's or any wrapped type's language.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  LocationgetLocation()
     Get this type's or any wrapped type's location.
public  LocationgetLocation(boolean forward)
     Get this type's or any wrapped type's location.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  StringgetScope()
     Get this type's or any wrapped type's scope.
public  StringgetScope(boolean forward)
     Get this type's or any wrapped type's scope.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  ReferencegetShape()
     Get this type's or any wrapped type's shape.
public  ReferencegetShape(boolean forward)
     Get this type's or any wrapped type's shape.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  booleanhasAlias()
     Determine whether this type contains an alias.
public  booleanhasAnnotated()
     Determine whether this type has an annotated type.
public  booleanhasAttribute(Attribute att)
     Determine whether this type or any wrapped type has the specified attribute.
public  booleanhasAttribute(Attribute att, boolean forward)
     Determine whether this type or any wrapped type has the specified attribute.
Parameters:
  att - The attribute.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  booleanhasAttribute(String name)
     Determine whether this type has an attribute with the specified name.
public  booleanhasAttribute(String name, boolean forward)
     Determine whether this type has an attribute with the specified name.
public  booleanhasAttributes()
     Determine whether this type has any attributes.
public  booleanhasConstant()
     Determine whether this type or any wrapped type has a constant.
public  booleanhasConstant(boolean forward)
     Determine whether this type or any wrapped type has a constant.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  booleanhasEnum()
     Determine whether this type contains an enum.
public  booleanhasEnumerator()
     Determine whether this type contains an enumerator.
public  booleanhasError()
     Determine whether this type has an error.
public  booleanhasInstantiated()
     Determine whether this type has an instantiated type.
public  booleanhasLanguage()
     Determine whether this type or any wrapped type has a language.
public  booleanhasLanguage(boolean forward)
     Determine whether this type or any wrapped type has a language.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  booleanhasLocation()
     Determine whether this type or any wrapped type has a location.
public  booleanhasLocation(boolean forward)
     Determine whether this type or any wrapped type has a location.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  booleanhasParameterized()
     Determine whether this type has a parameterized type.
public  booleanhasScope()
     Determine whether this type or any wrapped type has a scope.
public  booleanhasScope(boolean forward)
     Determine whether this type or any wrapped type has a scope.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  booleanhasShape()
     Determine whether this type or any wrapped type has a shape.
public  booleanhasShape(boolean forward)
     Determine whether this type or any wrapped type has a shape.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types.
public  booleanhasStructOrUnion()
     Determine whether this type contains a struct or union.
public  booleanhasTag(Tag tag)
     Determine whether this type has the specified tag.
public  booleanhasTagged()
     Determine whether this type is tagged.
public  booleanhasVariable()
     Determine whether this type contains a variable.
public  booleanhasWTag(Tag tag)
     Determine whether this wrapped type has the specified tag. Invocations to this method are not forwarded across wrapped types.
public  booleanisAlias()
     Determine whether this type is an alias.
public  booleanisAnnotated()
     Determine whether this type is annotated.
public  booleanisArray()
     Determine whether this type is an array.
public  booleanisBoolean()
     Determine whether this type is a boolean.
public  booleanisClass()
     Determine whether this type is a class.
public  booleanisConcrete()
     Determine whether this type is concrete.
public  booleanisDerived()
     Determine whether this type is derived.
public  booleanisEnum()
     Determine whether this type is an enum.
public  booleanisEnumerator()
     Determine whether this type is an enumerator.
public  booleanisError()
     Determine whether this type is an error.
public  booleanisFloat()
     Determine whether this type is a float.
public  booleanisFunction()
     Determine whether this type is a function.
public  booleanisInstantiated()
     Determine whether this type is instantiated.
public  booleanisInteger()
     Determine whether this type is an integer.
public  booleanisInterface()
     Determine whether this type is an interface.
public  booleanisInternal()
     Determine whether this type is internal.
public  booleanisLabel()
     Determine whether this type is a label.
public  booleanisMethod()
     Determine whether this type is a method.
public  booleanisNumber()
     Determine whether this type is a number.
public  booleanisPackage()
     Determine whether this type is a package.
public  booleanisParameter()
     Determine whether this type is a type parameter.
public  booleanisParameterized()
     Determine whether this type is parameterized.
public  booleanisPointer()
     Determine whether this type is a pointer.
public  booleanisSealed()
     Determine whether this type is sealed.
public  booleanisStruct()
     Determine whether this type is a struct.
public  booleanisTuple()
     Determine whether this type is an tuple.
public  booleanisUnion()
     Determine whether this type is a union.
public  booleanisUnit()
     Determine whether this type is the unit type.
public  booleanisVariable()
     Determine whether this type is a variable.
public  booleanisVariant()
     Determine whether this type is an variant.
public  booleanisVoid()
     Determine whether this type is void.
public  booleanisWildcard()
     Determine whether this type is a wildcard.
public  booleanisWrapped()
     Determine whether this type is wrapped.
public  Typelanguage(Language language)
     Set this type's language.
Parameters:
  language - The language.
public  Typelocate(Location location)
     Set this type's location.
Parameters:
  location - The location.
public  Typelocate(Locatable locatable)
     Set this type's location.
Parameters:
  locatable - The locatable.
public  voidmark(Node node)
     Mark the specified node as having this type.
public  Set<String>properties()
    
public  booleanremoveAttribute(Attribute att)
     Remove the specified attribute.
public  ObjectremoveProperty(String name)
    
public  Typeresolve()
     Resolve this type.
public static  Typeresolve(Object type)
     Resolve the specified object as type.
Parameters:
  type - The type.
public  Typescope(String scope)
     Set this type's scope.
Parameters:
  scope - The scope.
public  Typeseal()
     Seal this type.
public static  List<T>seal(List<T> types)
     Seal the specified list of types.
public  voidsetLocation(Location location)
    
public  voidsetLocation(Locatable locatable)
    
public  ObjectsetProperty(String name, Object value)
    
public  Typeshape(boolean isStatic, String name)
     Set this type's shape to a variable reference with the specified name.
See Also:   StaticReference
See Also:   DynamicReference
See Also:   Type.shape(Reference)
Parameters:
  isStatic - The flag for whether the variable is static.
Parameters:
  name - The variable name.
public  Typeshape(Reference shape)
     Set this type's shape.
Parameters:
  shape - The shape represented as a reference.
abstract public  Tagtag()
     Get this type's tag.
public  AliasTtoAlias()
     Get this type as an alias.
public  AnnotatedTtoAnnotated()
     Get this type as an annotated type.
public  ArrayTtoArray()
     Get this type as an array.
public  BooleanTtoBoolean()
     Get this type as a boolean.
public  ClassTtoClass()
     Get this type as a class.
public  EnumTtoEnum()
     Get this type as an enum.
public  EnumeratorTtoEnumerator()
     Get this type as an enumerator.
public  FloatTtoFloat()
     Get this type as a float.
public  FunctionTtoFunction()
     Get this type as a function.
public  InstantiatedTtoInstantiated()
     Get this type as an instantiated type.
public  IntegerTtoInteger()
     Get this type as an integer.
public  InterfaceTtoInterface()
     Get this type as an interface.
public  InternalTtoInternal()
     Get this type as an internal type.
public  LabelTtoLabel()
     Get this type as a label.
public  MethodTtoMethod()
     Get this type as a method.
public  NumberTtoNumber()
     Get this type as a number.
public  PackageTtoPackage()
     Get this type as a package.
public  ParametertoParameter()
     Get this type as a type parameter.
public  ParameterizedTtoParameterized()
     Get this type as a parameterized type.
public  PointerTtoPointer()
     Get this type as a pointer.
public  StructTtoStruct()
     Get this type as a struct.
public  TaggedtoTagged()
     Get this type as a tagged type.
public  TupleTtoTuple()
     Get this type as an tuple.
public  UnionTtoUnion()
     Get this type as a union.
public  UnitTtoUnit()
     Get this type as a unit type.
public  VariableTtoVariable()
     Get this type as a variable.
public  VariantTtoVariant()
     Get this type as an variant.
public  VoidTtoVoid()
     Get this type as a void type.
public  WildcardtoWildcard()
     Get this type as a wildcard.
public  WrappedTtoWrapped()
     Get this type as a wrapped type.
public  voidtrace(Runtime runtime)
     Trace this type to the runtime's console.
public  Tagwtag()
     Get this wrapped type's tag.

Field Detail
attributes
List<Attribute> attributes(Code)
This type's attributes.



constant
Constant constant(Code)
This type's constant value.



language
Language language(Code)
This type's language.



scope
String scope(Code)
This type's scope.



sealed
boolean sealed(Code)
The flag for whether this type is sealed.



shape
Reference shape(Code)
This type's shape.




Constructor Detail
Type
public Type()(Code)
Create a new type. The newly created type does not have any annotations and is not sealed.



Type
public Type(Type template)(Code)
Create a new type. The newly created type is not sealed. Its annotations are a copy of the specified template's annotations.
Parameters:
  template - The type whose annotations to copy.




Method Detail
addAttribute
public void addAttribute(Attribute att)(Code)
Add the specified attribute. This method adds the specified attribute to this type's list of attributes — without checking whether the type already has that attribute. For almost all applications of attributes, it is preferable to use Type.attribute(Attribute) , Type.attribute(List) , or Type.attribute(Type) .
Parameters:
  att - The new attribute.
throws:
  IllegalStateException - Signals that this type is sealed.



annotate
public Type annotate()(Code)
Annotate this type. If this type is not an annotated type or a sealed annotated type, this method wraps this type in a new AnnotatedT . The annotated type.



attribute
public Type attribute(Attribute att)(Code)
Annotate this type with the specified attribute. If this type or any wrapped type does not have the specified attribute, this method adds the attribute to this type's list of attributes.
Parameters:
  att - The attribute. This type.
throws:
  IllegalStateException - Signals that this type is sealed.



attribute
public Type attribute(List<Attribute> attributes)(Code)
Annotate this type with the specified attributes.
See Also:   Type.attribute(Attribute)
Parameters:
  attributes - The attributes. This type.
throws:
  IllegalStateException - Signals that this type is sealed.



attribute
public Type attribute(Type template)(Code)
Annotate this type with the specified type's attributes.
Parameters:
  template - The type whose annotations to copy. This type.
throws:
  IllegalStateException - Signals that this type is sealed.



attributes
public List<Attribute> attributes()(Code)
Get this type's attributes. This type's attributes.



cast
public static Type cast(Object type)(Code)
Cast the specified object to a type.
Parameters:
  type - The type as an object. The type as a type.
throws:
  ClassCastException - Signals that the specified object isnot a type.



checkNotSealed
protected void checkNotSealed()(Code)
Ensure that this type is not sealed. This method must be called by any subclass before modifying its internal state.
throws:
  IllegalStateException - Signals that this type is sealed.



constant
public Type constant(boolean value)(Code)
Set this type's constant.
See Also:   Type.constant(Object)
Parameters:
  value - The value. This type.
throws:
  IllegalStateException - Signals that this type is sealed.



constant
public Type constant(Object value)(Code)
Set this type's constant.
Parameters:
  value - The value. This type.
throws:
  IllegalArgumentException - Signals an invalid value.
throws:
  IllegalStateException - Signals that this type is sealed.



copy
abstract public Type copy()(Code)
Create a deep copy of this type. The resulting type is not sealed. A deep copy of this type.



copy
public static List<T> copy(List<T> types)(Code)
Copy the specified list of types. A null list is ignored.
Parameters:
  types - The list of types. A new list of the types' copies.



deannotate
public Type deannotate()(Code)
Deannotate this type. This method strips away any AnnotatedT from this type. The deannotated type.



getAttribute
public Attribute getAttribute(String name)(Code)
Get the attribute with the specified name. Calling this method on type t is equivalent to:
 t.getAttribute(name, true)
 

See Also:   Type.getAttribute(String,boolean)
Parameters:
  name - The name. An attribute with that name or null if thistype or any wrapped type does not have such an attribute.



getAttribute
public Attribute getAttribute(String name, boolean forward)(Code)
Get the attribute with the specified name.
Parameters:
  name - The name.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. An attribute with the name or null if thisor any wrapped type does not have such an attribute.



getConstant
public Constant getConstant()(Code)
Get this type's or any wrapped type's constant. Calling this method on type t is equivalent to:
 t.getConstant(true)
 

See Also:   Type.getConstant(boolean) The constant or null if this type or anywrapped type does not have a constant.



getConstant
public Constant getConstant(boolean forward)(Code)
Get this type's or any wrapped type's constant.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. The constant or null if this type or anywrapped type does not have a constant.



getLanguage
public Language getLanguage()(Code)
Get this type's or any wrapped type's language. Calling this method on type t is equivalent to:
 t.getLanguage(true)
 

See Also:   Type.getLanguage(boolean) The language or null if this type or anywrapped type does not have a language.



getLanguage
public Language getLanguage(boolean forward)(Code)
Get this type's or any wrapped type's language.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. The language or null if this type or anywrapped type does not have a language.



getLocation
public Location getLocation()(Code)
Get this type's or any wrapped type's location. Calling this method on type t is equivalent to:
 t.getLocation(true)
 

See Also:   Type.getLocation(boolean) The location or null if this type or anywrapped type does not have a location.



getLocation
public Location getLocation(boolean forward)(Code)
Get this type's or any wrapped type's location.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. The location or null if this type or anywrapped type does not have a location.



getScope
public String getScope()(Code)
Get this type's or any wrapped type's scope. Calling this method on type t is equivalent to:
 t.getScope(true)
 

See Also:   Type.getScope(boolean) The scope or null if this type or anywrapped type does not have a scope.



getScope
public String getScope(boolean forward)(Code)
Get this type's or any wrapped type's scope.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. The scope or null if this type or anywrapped type does not have a scope.



getShape
public Reference getShape()(Code)
Get this type's or any wrapped type's shape. Calling this method on type t is equivalent to:
 t.getShape(true)
 

See Also:   Type.getShape(boolean) The shape or null if this type or anywrapped type does not have a shape.



getShape
public Reference getShape(boolean forward)(Code)
Get this type's or any wrapped type's shape.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. The shape or null if this type or anywrapped type does not have a shape.



hasAlias
public boolean hasAlias()(Code)
Determine whether this type contains an alias. true if this type contains an alias.



hasAnnotated
public boolean hasAnnotated()(Code)
Determine whether this type has an annotated type. true if this type has an annotated type.



hasAttribute
public boolean hasAttribute(Attribute att)(Code)
Determine whether this type or any wrapped type has the specified attribute. Calling this method on type t is equivalent to:
 t.hasAttribute(att, true)
 

See Also:   Type.hasAttribute(Attribute,boolean)
Parameters:
  att - The attribute. true if this type or any wrapped type hasthe attribute.



hasAttribute
public boolean hasAttribute(Attribute att, boolean forward)(Code)
Determine whether this type or any wrapped type has the specified attribute.
Parameters:
  att - The attribute.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. true if this type or any wrapped type hasthe attribute.



hasAttribute
public boolean hasAttribute(String name)(Code)
Determine whether this type has an attribute with the specified name. Calling this method on type t is equivalent to:
 null != t.getAttribute(name, true)
 

See Also:   Type.getAttribute(String,boolean)
Parameters:
  name - The name. true if this type or any wrapped type hasan attribute with the specified name.



hasAttribute
public boolean hasAttribute(String name, boolean forward)(Code)
Determine whether this type has an attribute with the specified name. Calling this method on type t is equivalent to:
 null != t.getAttribute(name, forward)
 
#getAttribute(String,boolean)
Parameters:
  name - The name.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. true if this type or any wrapped type hasan attribute with the specified name.



hasAttributes
public boolean hasAttributes()(Code)
Determine whether this type has any attributes. Note that this method does not check any wrapped types. true if this type has any attributes.



hasConstant
public boolean hasConstant()(Code)
Determine whether this type or any wrapped type has a constant. Calling this method on type t is equivalent to:
 t.hasConstant(true)
 

See Also:   Type.hasConstant(boolean) true if this type has a constant.



hasConstant
public boolean hasConstant(boolean forward)(Code)
Determine whether this type or any wrapped type has a constant.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. true if this type or any wrapped type has aconstant.



hasEnum
public boolean hasEnum()(Code)
Determine whether this type contains an enum. true if this type contains an enum.



hasEnumerator
public boolean hasEnumerator()(Code)
Determine whether this type contains an enumerator. true if this type contains an enumerator.



hasError
public boolean hasError()(Code)
Determine whether this type has an error. This method identifies the ErrorT error type even if it is wrapped. Calling this method on type t is equivalent to:
 Type.Tag.Error == tag()
 

See Also:   Type.tag() true if this type has an error.



hasInstantiated
public boolean hasInstantiated()(Code)
Determine whether this type has an instantiated type. true if this type has an instantiated type.



hasLanguage
public boolean hasLanguage()(Code)
Determine whether this type or any wrapped type has a language. Calling this method on type t is equivalent to:
 t.hasLanguage(true)
 

See Also:   Type.hasLanguage(boolean) true if this type or any wrapped type has alanguage.



hasLanguage
public boolean hasLanguage(boolean forward)(Code)
Determine whether this type or any wrapped type has a language.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. true if this type or any wrapped type has alanguage.



hasLocation
public boolean hasLocation()(Code)
Determine whether this type or any wrapped type has a location. Calling this method on type t is equivalent to:
 t.hasLocation(true)
 

See Also:   Type.hasLocation(boolean) true if this type or any wrapped type has alocation.



hasLocation
public boolean hasLocation(boolean forward)(Code)
Determine whether this type or any wrapped type has a location.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. true if this type or any wrapped type has alocation.



hasParameterized
public boolean hasParameterized()(Code)
Determine whether this type has a parameterized type. true if this type has a parameterized type.



hasScope
public boolean hasScope()(Code)
Determine whether this type or any wrapped type has a scope. Calling this method on type t is equivalent to:
 t.hasScope(true)
 

See Also:   Type.hasScope(boolean) true if this type or any wrapped type has ascope.



hasScope
public boolean hasScope(boolean forward)(Code)
Determine whether this type or any wrapped type has a scope.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. true if this type or any wrapped type has ascope.



hasShape
public boolean hasShape()(Code)
Determine whether this type or any wrapped type has a shape. Calling this method on type t is equivalent to:
 t.hasShape(true)
 

See Also:   Type.hasShape(boolean) true if this type or any wrapped type has ashape.



hasShape
public boolean hasShape(boolean forward)(Code)
Determine whether this type or any wrapped type has a shape.
Parameters:
  forward - The flag for whether to forward this method acrosswrapped types. true if this type or any wrapped type has ashape.



hasStructOrUnion
public boolean hasStructOrUnion()(Code)
Determine whether this type contains a struct or union. true if this type contains a struct orunion.



hasTag
public boolean hasTag(Tag tag)(Code)
Determine whether this type has the specified tag. Invocations to this method are forwarded across wrapped types. Calling this method on type t is equivalent to:
 tag == t.tag()
 

See Also:   Type.tag()
Parameters:
  tag - The tag. true if this type has the specified tag.



hasTagged
public boolean hasTagged()(Code)
Determine whether this type is tagged. true if this type is tagged.



hasVariable
public boolean hasVariable()(Code)
Determine whether this type contains a variable. true if this type contains a variable.



hasWTag
public boolean hasWTag(Tag tag)(Code)
Determine whether this wrapped type has the specified tag. Invocations to this method are not forwarded across wrapped types. Calling this method on type t is equivalent to:
 tag == wtag()
 

See Also:   Type.wtag()
Parameters:
  tag - The tag. true if this wrapped type has the specifiedtag.



isAlias
public boolean isAlias()(Code)
Determine whether this type is an alias. true if this type is an alias.



isAnnotated
public boolean isAnnotated()(Code)
Determine whether this type is annotated. true if this type is annotated.



isArray
public boolean isArray()(Code)
Determine whether this type is an array. true if this type is an array.



isBoolean
public boolean isBoolean()(Code)
Determine whether this type is a boolean. true if this type is a boolean.



isClass
public boolean isClass()(Code)
Determine whether this type is a class. true if this type is a class.



isConcrete
public boolean isConcrete()(Code)
Determine whether this type is concrete. This method returns true if this type is not parameterized or is both parameterized and instantiated. true if this type is concrete.



isDerived
public boolean isDerived()(Code)
Determine whether this type is derived. true if this type is derived.



isEnum
public boolean isEnum()(Code)
Determine whether this type is an enum. true if this type is an enum.



isEnumerator
public boolean isEnumerator()(Code)
Determine whether this type is an enumerator. true if this type is an enumerator.



isError
public boolean isError()(Code)
Determine whether this type is an error. #hasError() true if this type is internal.



isFloat
public boolean isFloat()(Code)
Determine whether this type is a float. true if this type is a float.



isFunction
public boolean isFunction()(Code)
Determine whether this type is a function. true if this type is a function.



isInstantiated
public boolean isInstantiated()(Code)
Determine whether this type is instantiated. true if this type is instantiated.



isInteger
public boolean isInteger()(Code)
Determine whether this type is an integer. true if this type is an integer.



isInterface
public boolean isInterface()(Code)
Determine whether this type is an interface. true if this type is an interface.



isInternal
public boolean isInternal()(Code)
Determine whether this type is internal. true if this type is internal.



isLabel
public boolean isLabel()(Code)
Determine whether this type is a label. true if this type is a label.



isMethod
public boolean isMethod()(Code)
Determine whether this type is a method. true if this type is a method.



isNumber
public boolean isNumber()(Code)
Determine whether this type is a number. true if this type is a number.



isPackage
public boolean isPackage()(Code)
Determine whether this type is a package. true if this type is a package.



isParameter
public boolean isParameter()(Code)
Determine whether this type is a type parameter. true if this type is a parameter.



isParameterized
public boolean isParameterized()(Code)
Determine whether this type is parameterized. true if this type is parameterized.



isPointer
public boolean isPointer()(Code)
Determine whether this type is a pointer. true if this type is a pointer.



isSealed
public boolean isSealed()(Code)
Determine whether this type is sealed. true if this type is sealed.



isStruct
public boolean isStruct()(Code)
Determine whether this type is a struct. true if this type is a struct.



isTuple
public boolean isTuple()(Code)
Determine whether this type is an tuple. true if this type is an tuple.



isUnion
public boolean isUnion()(Code)
Determine whether this type is a union. true if this type is a union.



isUnit
public boolean isUnit()(Code)
Determine whether this type is the unit type. true if this type is the unit type.



isVariable
public boolean isVariable()(Code)
Determine whether this type is a variable. true if this type is a variable.



isVariant
public boolean isVariant()(Code)
Determine whether this type is an variant. true if this type is an variant.



isVoid
public boolean isVoid()(Code)
Determine whether this type is void. true if this type is void.



isWildcard
public boolean isWildcard()(Code)
Determine whether this type is a wildcard. true if this type is a wildcard.



isWrapped
public boolean isWrapped()(Code)
Determine whether this type is wrapped. true if this type is wrapped.



language
public Type language(Language language)(Code)
Set this type's language.
Parameters:
  language - The language. This type.
throws:
  IllegalStateException - Signals that this type is sealed.



locate
public Type locate(Location location)(Code)
Set this type's location.
Parameters:
  location - The location. This type.
throws:
  IllegalStateException - Signals that this type is sealed.



locate
public Type locate(Locatable locatable)(Code)
Set this type's location.
Parameters:
  locatable - The locatable. This type.
throws:
  IllegalStateException - Signals that this type is sealed.



mark
public void mark(Node node)(Code)
Mark the specified node as having this type. This method sets the node's Constants.TYPE type property to this type.
Parameters:
  node - The node.
throws:
  IllegalArgumentException - Signals that the node alreadyhas a type property.



properties
public Set<String> properties()(Code)



removeAttribute
public boolean removeAttribute(Attribute att)(Code)
Remove the specified attribute. Note that this method does not remove the attribute from any wrapped types.
Parameters:
  att - The attribute. true if this type had the specifiedattribute.
throws:
  IllegalStateException - Signals that this type is sealed.



removeProperty
public Object removeProperty(String name)(Code)



resolve
public Type resolve()(Code)
Resolve this type. This method removes any symbolic information, i.e., wrapped types, and returns the underlying, "raw" type. The resolved type.



resolve
public static Type resolve(Object type)(Code)
Resolve the specified object as type.
Parameters:
  type - The type. The resolved type.
throws:
  ClassCastException - Signals that the specified object isnot a type.



scope
public Type scope(String scope)(Code)
Set this type's scope.
Parameters:
  scope - The scope. This type.
throws:
  IllegalStateException - Signals that this type is sealed.



seal
public Type seal()(Code)
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.
See Also:   Type.seal(List) This type.



seal
public static List<T> seal(List<T> types)(Code)
Seal the specified list of types. A null list is ignored.
Parameters:
  types - The list of types. An unmodifiable list of sealed types.



setLocation
public void setLocation(Location location)(Code)



setLocation
public void setLocation(Locatable locatable)(Code)



setProperty
public Object setProperty(String name, Object value)(Code)



shape
public Type shape(boolean isStatic, String name)(Code)
Set this type's shape to a variable reference with the specified name.
See Also:   StaticReference
See Also:   DynamicReference
See Also:   Type.shape(Reference)
Parameters:
  isStatic - The flag for whether the variable is static.
Parameters:
  name - The variable name. This type.
throws:
  IllegalStateException - Signals that this type is sealed.



shape
public Type shape(Reference shape)(Code)
Set this type's shape.
Parameters:
  shape - The shape represented as a reference. This type.
throws:
  IllegalStateException - Signals that this type is sealed.



tag
abstract public Tag tag()(Code)
Get this type's tag. Invocations to this method are forwarded across wrapped types.
See Also:   Type.wtag() This type's tag.



toAlias
public AliasT toAlias()(Code)
Get this type as an alias. This type as an alias.
throws:
  ClassCastException - Signals that this type is not analias.



toAnnotated
public AnnotatedT toAnnotated()(Code)
Get this type as an annotated type. This type as an annotated type.
throws:
  ClassCastException - Signas that this type is not anannotated type.



toArray
public ArrayT toArray()(Code)
Get this type as an array. This type as an array.
throws:
  ClassCastException - Signals that this type is not anarray.



toBoolean
public BooleanT toBoolean()(Code)
Get this type as a boolean. This type as a boolean.
throws:
  ClassCastException - Signals that this type is a not aboolean.



toClass
public ClassT toClass()(Code)
Get this type as a class. This type as a class.
throws:
  ClassCastException - Signals that this type is not a class.



toEnum
public EnumT toEnum()(Code)
Get this type as an enum. This type as an enum.
throws:
  ClassCastException - Signals that this type is not an enum.



toEnumerator
public EnumeratorT toEnumerator()(Code)
Get this type as an enumerator. This type as an enumerator.
throws:
  ClassCastException - Signals that this type is not anenumerator.



toFloat
public FloatT toFloat()(Code)
Get this type as a float. This type as a float.
throws:
  ClassCastException - Signals that this type is not afloat.



toFunction
public FunctionT toFunction()(Code)
Get this type as a function. This type has a function.
throws:
  ClassCastException - Signals that this type is not afunction.



toInstantiated
public InstantiatedT toInstantiated()(Code)
Get this type as an instantiated type. This type as an instantiated type.
throws:
  ClassCastException - Signas that this type is not aninstantiated type.



toInteger
public IntegerT toInteger()(Code)
Get this type as an integer. This type as an integer.
throws:
  ClassCastException - Signals that this type is not aninteger.



toInterface
public InterfaceT toInterface()(Code)
Get this type as an interface. This type as an interface.
throws:
  ClassCastException - Signals that this type is not aninterface.



toInternal
public InternalT toInternal()(Code)
Get this type as an internal type. This type as an internal type.
throws:
  ClassCastException - Signals that this type is not aninternal type.



toLabel
public LabelT toLabel()(Code)
Get this type as a label. This type as a label.
throws:
  ClassCastException - Signals that this type is not alabel.



toMethod
public MethodT toMethod()(Code)
Get this type as a method. This type as a method.
throws:
  ClassCastException - Signals that this type is not amethod.



toNumber
public NumberT toNumber()(Code)
Get this type as a number. This type as a number.
throws:
  ClassCastException - Signals that this type is not anumber.



toPackage
public PackageT toPackage()(Code)
Get this type as a package. This type as a package.
throws:
  ClassCastException - Signals that this type is not apackage.



toParameter
public Parameter toParameter()(Code)
Get this type as a type parameter. This type as a parameter.
throws:
  ClassCastException - Signals that this type is not aparameter.



toParameterized
public ParameterizedT toParameterized()(Code)
Get this type as a parameterized type. This type as a parameterized type.
throws:
  ClassCastException - Signas that this type is not aparameterized type.



toPointer
public PointerT toPointer()(Code)
Get this type as a pointer. This type as a pointer.
throws:
  ClassCastException - Signals that this type is not apointer.



toStruct
public StructT toStruct()(Code)
Get this type as a struct. This type as a struct.
throws:
  ClassCastException - Signas that this type is not astruct.



toTagged
public Tagged toTagged()(Code)
Get this type as a tagged type.
See Also:   Type.hasTagged() This type as a tagged type.
throws:
  ClassCastException - Signals that this type is nottagged.



toTuple
public TupleT toTuple()(Code)
Get this type as an tuple. This type as an tuple.
throws:
  ClassCastException - Signals that this type is not an tuple.



toUnion
public UnionT toUnion()(Code)
Get this type as a union. This type as a union.
throws:
  ClassCastException - Signals that this type is not aunion.



toUnit
public UnitT toUnit()(Code)
Get this type as a unit type. This type as a unit type.
throws:
  ClassCastException - Signals that this type is not a unittype.



toVariable
public VariableT toVariable()(Code)
Get this type as a variable. This type as a variable.
throws:
  ClassCastException - Signals that this type does notcontain a variable.



toVariant
public VariantT toVariant()(Code)
Get this type as an variant. This type as an variant.
throws:
  ClassCastException - Signals that this type is not an variant.



toVoid
public VoidT toVoid()(Code)
Get this type as a void type. This type as a void type.
throws:
  ClassCastException - Signals that this type is not a voidtype.



toWildcard
public Wildcard toWildcard()(Code)
Get this type as a wildcard. This type as a wildcard.
throws:
  ClassCastException - Signals that this type is not awildcard.



toWrapped
public WrappedT toWrapped()(Code)
Get this type as a wrapped type. This type as a wrapped type.
throws:
  ClassCastException - Signals that this type is not wrapped.



trace
public void trace(Runtime runtime)(Code)
Trace this type to the runtime's console. This method prints this type to the runtime's console using a new instance of TypePrinter ; it is useful for debugging.
Parameters:
  runtime - The runtime.



wtag
public Tag wtag()(Code)
Get this wrapped type's tag. Invocations to this method are not forwarded across wrapped types.
See Also:   Type.tag() This wrapped type's tag.



Fields inherited from xtc.tree.Node
public Location location(Code)(Java Doc)

Methods inherited from xtc.tree.Node
public Object accept(Visitor v)(Code)(Java Doc)
public Object getProperty(String name)(Code)(Java Doc)
public boolean hasProperty(String name)(Code)(Java Doc)
public Iterator properties()(Code)(Java Doc)
public Object removeProperty(String name)(Code)(Java Doc)
public void setLocation(String file, int line, int column)(Code)(Java Doc)
public Object setProperty(String name, Object value)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.