gov.llnl.babel.symbols
Class SymbolID

java.lang.Object
  extended by gov.llnl.babel.symbols.ASTNode
      extended by gov.llnl.babel.symbols.SymbolID
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
Symbol

public class SymbolID
extends ASTNode
implements java.lang.Comparable

The SymbolID class represents the name of a symbol, which consists of a fully qualified name (e.g., "sidl.Object") and a version number. The equals and hashCode members have been defined such that two symbol ids are considered equal if they have the same version and string.


Field Summary
static java.lang.String SCOPE
           
 
Fields inherited from class gov.llnl.babel.symbols.ASTNode
d_frozen
 
Constructor Summary
SymbolID(java.lang.String fully_qualified_name, Version version)
          The constructor for the SymbolID class takes a fully qualified symbol name and a symbol version.
SymbolID(java.lang.String fully_qualified_name, Version version, boolean fromxml)
          The constructor for the SymbolID class takes a fully qualified symbol name and a symbol version.
SymbolID(SymbolID id)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare this SymbolID with another one.
 boolean equals(java.lang.Object obj)
          Two symbol identifiers are identical only if they have the same symbol identifiers and the same version.
 boolean fromXML()
           
 java.lang.String getFullName()
          Return the fully qualified name of the symbol.
 java.lang.String getShortName()
          Return the short, relative name of the symbol.
static java.lang.String getShortName(java.lang.String fqn)
          Return the short, relative name of the fully qualified name.
 java.lang.String getSymbolName()
          Return the symbol name of the form "NAME-vVERSION".
 Version getVersion()
          Return the version of the symbol.
 int hashCode()
          Return the hash code of the symbol name as the hash value for a symbol identifier to facilitiate searching in hash tables.
 boolean isSymbolBindC()
          Return true if symbol is something the bindC array manipulation can deal with
 void setFromXML(boolean fromxml)
           
 
Methods inherited from class gov.llnl.babel.symbols.ASTNode
checkFrozen, clone, freeze, protectCollection, protectList, protectMap, protectSet
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCOPE

public static final java.lang.String SCOPE
See Also:
Constant Field Values
Constructor Detail

SymbolID

public SymbolID(java.lang.String fully_qualified_name,
                Version version)
The constructor for the SymbolID class takes a fully qualified symbol name and a symbol version.


SymbolID

public SymbolID(SymbolID id)

SymbolID

public SymbolID(java.lang.String fully_qualified_name,
                Version version,
                boolean fromxml)
The constructor for the SymbolID class takes a fully qualified symbol name and a symbol version. Flag fromxml indicates whether symbol originates from xml repository.

Method Detail

getFullName

public java.lang.String getFullName()
Return the fully qualified name of the symbol.


getShortName

public static java.lang.String getShortName(java.lang.String fqn)
Return the short, relative name of the fully qualified name.


getShortName

public java.lang.String getShortName()
Return the short, relative name of the symbol.


isSymbolBindC

public boolean isSymbolBindC()
Return true if symbol is something the bindC array manipulation can deal with


getVersion

public Version getVersion()
Return the version of the symbol.


getSymbolName

public java.lang.String getSymbolName()
Return the symbol name of the form "NAME-vVERSION".


hashCode

public int hashCode()
Return the hash code of the symbol name as the hash value for a symbol identifier to facilitiate searching in hash tables.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Two symbol identifiers are identical only if they have the same symbol identifiers and the same version.

Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Compare this SymbolID with another one.

Specified by:
compareTo in interface java.lang.Comparable

fromXML

public boolean fromXML()

setFromXML

public void setFromXML(boolean fromxml)