gov.llnl.babel.symbols
Class Package

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.Package
All Implemented Interfaces:
Attributes, IMetadata, java.lang.Comparable

public class Package
extends Symbol

The Package class describes a sidl package naming scope. Along with the standard sidl identifier, metadata, and comment, it contains a list of included symbols and their symbol type.


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
Package(SymbolID id, Comment comment, Context context)
          Create a new Package with the specified symbol identifier and comment.
Package(SymbolID id, Comment comment, Metadata metadata, Context context)
          Create a new Package with the specified symbol identifier, comment, and metadata.
 
Method Summary
 void addSymbol(SymbolID id, int type)
          Add a symbol to the list of local references for this package.
 void freeze()
           
 java.util.Set getAllSymbolReferences()
          Return the symbol references for the whole type hierarchy rooted with this symbol.
 java.util.Set getBasicArrayRefs()
          Return an empty set.
 boolean getFinal()
          Return true if and only if a package is final.
 java.util.Collection getOrderedSymbolReferences()
          Return the symbols referenced by this package in an ordered Collection of objects.
 java.lang.String getScopedName(java.lang.String name)
          Convert the specified short name into a fully qualified name within this package scope.
 java.util.Set getSymbolReferences()
          Return the symbols referenced by this package as a Set of objects.
 java.util.Map getSymbols()
          Return the set of symbols referenced by this package.
 void setFinal(boolean isFinal)
           
 
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

Package

public Package(SymbolID id,
               Comment comment,
               Context context)
Create a new Package with the specified symbol identifier and comment.


Package

public Package(SymbolID id,
               Comment comment,
               Metadata metadata,
               Context context)
Create a new Package with the specified symbol identifier, comment, and metadata.

Method Detail

addSymbol

public void addSymbol(SymbolID id,
                      int type)
Add a symbol to the list of local references for this package. Note that a single symbol may be added multiple times to the hash table. The version of the symbol added to this package will be the same version as the package itself. The argument must be a fully qualified name.


getScopedName

public java.lang.String getScopedName(java.lang.String name)
Convert the specified short name into a fully qualified name within this package scope.


getSymbolReferences

public java.util.Set getSymbolReferences()
Return the symbols referenced by this package as a Set of objects.

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

getOrderedSymbolReferences

public java.util.Collection getOrderedSymbolReferences()
Return the symbols referenced by this package in an ordered Collection of objects.


getBasicArrayRefs

public java.util.Set getBasicArrayRefs()
Return an empty set.

Specified by:
getBasicArrayRefs in class Symbol

getSymbols

public java.util.Map getSymbols()
Return the set of symbols referenced by this package. The key in the Map is a SymbolID and the value is its type in integer form as defined in Symbol.


getFinal

public boolean getFinal()
Return true if and only if a package is final. If a package is final, it is non-reentrant; a non-final package is reentrant.


setFinal

public void setFinal(boolean isFinal)

freeze

public void freeze()
Overrides:
freeze in class Symbol