gov.llnl.babel.symbols
Class Struct

java.lang.Object
  extended by gov.llnl.babel.symbols.ASTNode
      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, ENUM, INTERFACE, PACKAGE, s_type, SCOPE, STRUCT
 
Constructor Summary
Struct(SymbolID id, Comment comment)
           
Struct(SymbolID id, Comment comment, Metadata metadata)
           
 
Method Summary
 int addItem(java.lang.String name, Type type)
          Insert a new type and name into the struct
 int addItem(Struct.Item i)
           
 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()
           
 
Methods inherited from class gov.llnl.babel.symbols.Symbol
addMetadata, compareTo, getAttribute, getAttributes, getComment, getDepth, getFullName, getMetadata, getSymbolID, getSymbolType, getSymbolTypeString, getUserSpecified, hasAttribute, isInterface, isPackage, minimumDepth, removeAttribute, setAttribute, setAttribute, setComment, setUserSpecified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Struct

public Struct(SymbolID id,
              Comment comment)

Struct

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

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