gov.llnl.babel.symbols
Class Struct

java.lang.Object
  extended by gov.llnl.babel.symbols.ASTNode
      extended by gov.llnl.babel.symbols.SymbolID
          extended by gov.llnl.babel.symbols.Symbol
              extended by gov.llnl.babel.symbols.Struct
All Implemented Interfaces:
Attributes, IMetadata, java.lang.Comparable

public class Struct
extends Symbol

The Struct contains a list of named types.


Nested Class Summary
static class Struct.Item
           
 
Field Summary
 
Fields inherited from class gov.llnl.babel.symbols.Symbol
CLASS, d_context, ENUM, INTERFACE, PACKAGE, s_type, SCOPE, STRUCT
 
Fields inherited from class gov.llnl.babel.symbols.ASTNode
d_frozen
 
Constructor Summary
Struct(SymbolID id, Comment comment, Context context)
           
Struct(SymbolID id, Comment comment, Metadata metadata, Context context)
           
 
Method Summary
 int addItem(java.lang.String name, Type type)
          Insert a new type and name into the struct
 int addItem(Struct.Item i)
           
 void freeze()
           
 java.util.Set getAllSymbolReferences()
          Return the symbol references for the whole type hierarchy rooted with this symbol.
 java.util.Set getBasicArrayRefs()
          Return the set of all references to arrays of fundamental types.
 java.util.List getItems()
           
 java.util.Set getSymbolReferences()
          Return the set of symbols (in the form of SymbolID) referenced by this particular symbol.
 boolean hasArrayReference()
           
 boolean hasType(int type)
           
 boolean hasTypeEmbedded(int type)
           
 
Methods inherited from class gov.llnl.babel.symbols.Symbol
addMetadata, getAttribute, getAttributes, getComment, getDepth, getMetadata, getSymbolID, getSymbolType, getSymbolTypeString, getUserSpecified, hasAttribute, isClass, isInterface, isPackage, isStruct, minimumDepth, removeAttribute, setAttribute, setAttribute, setComment, setUserSpecified
 
Methods inherited from class gov.llnl.babel.symbols.SymbolID
compareTo, equals, fromXML, getFullName, getShortName, getShortName, getSymbolName, getVersion, hashCode, setFromXML
 
Methods inherited from class gov.llnl.babel.symbols.ASTNode
checkFrozen, clone, protectCollection, protectList, protectMap, protectSet
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

Struct

public Struct(SymbolID id,
              Comment comment,
              Context context)

Struct

public Struct(SymbolID id,
              Comment comment,
              Metadata metadata,
              Context context)
Method Detail

hasType

public boolean hasType(int type)

hasTypeEmbedded

public boolean hasTypeEmbedded(int type)

getSymbolReferences

public java.util.Set getSymbolReferences()
Description copied from class: Symbol
Return the set of symbols (in the form of SymbolID) referenced by this particular symbol. The return argument may be null if this symbol contains no external references.

Specified by:
getSymbolReferences in class Symbol

getAllSymbolReferences

public java.util.Set getAllSymbolReferences()
Description copied from class: Symbol
Return the symbol references for the whole type hierarchy rooted with this symbol. For packages, this recurses down the package hierarchy.

Specified by:
getAllSymbolReferences in class Symbol

getBasicArrayRefs

public java.util.Set getBasicArrayRefs()
Description copied from class: Symbol
Return the set of all references to arrays of fundamental types.

Specified by:
getBasicArrayRefs in class Symbol

getItems

public java.util.List getItems()
Returns:
ordered list of items. Each element is an Struct.Item.

addItem

public int addItem(Struct.Item i)

hasArrayReference

public boolean hasArrayReference()

addItem

public int addItem(java.lang.String name,
                   Type type)
Insert a new type and name into the struct

Returns:
new number of items in the struct

freeze

public void freeze()
Overrides:
freeze in class Symbol