|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.llnl.babel.symbols.Symbol | +--gov.llnl.babel.symbols.Extendable
Class Extendable
is a base class for SIDL symbols of type
class and interface. It brings together common methods and implementation
for both final classes. Class and interfaces have a set of methods and
interface inheritance in common. Classes have the additional property
that they can be extended by another class; that functionality is not
defined here. Many of the member functions take a boolean argument that
selects whether the method refers to this particular extendable only or
to this extendable and all of its parents in the SIDL inheritance system.
Constraints on the validity of methods added to this object must be checked
by the parser.
Key design goals include providing mechanisms to:
- ensure method lookups in O(1) by both long and short names;
- ensure fast return of abstract, static, non-static, local, and both
local and parent (or all) methods;
- ensure original ordering of methods preserved when returning lists;
Field Summary |
Fields inherited from class gov.llnl.babel.symbols.Symbol |
CLASS, ENUM, INTERFACE, PACKAGE, s_type, SCOPE |
Constructor Summary | |
Extendable(SymbolID id,
int type,
Comment comment)
Create an empty Extendable object that will be constructed
by calls to other member functions. |
|
Extendable(SymbolID id,
int type,
Comment comment,
Metadata m)
Create an empty Extendable object that will be constructed
by calls to other member functions. |
Method Summary | |
void |
addMethod(Method method)
Add a new method to this object. |
protected void |
addParentData(Extendable ext)
Protected method called by parents to add their methods and their interfaces to this extendable object. |
abstract void |
addParentInterface(Interface parent)
Add a new parent interface to this class. |
java.util.Collection |
getAbstractMethods()
Return the abstract methods for this class or interface, which includes all parent classes and interfaces. |
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 basic array types for this class. |
java.util.Collection |
getMethods(boolean all)
Return the methods in this interface as a Collection . |
java.util.Collection |
getNonstaticMethods(boolean all)
Return the non-static methods in this interface as a Collection . |
java.util.Collection |
getParentInterfaces(boolean all)
Return the parent interfaces in a Collection . |
java.util.Collection |
getStaticMethods(boolean all)
Return the static methods in this interface as a Collection . |
java.util.Set |
getSymbolReferences()
Return the set of symbol references for this class. |
boolean |
hasExceptionThrowingMethod(boolean all)
Return whether any of the methods throw exceptions. |
boolean |
hasMethodByLongName(java.lang.String name,
boolean all)
Query whether the specified method exists by long name. |
boolean |
hasMethodByShortName(java.lang.String name,
boolean all)
Query whether the specified method exists by short name. |
boolean |
hasParentInterface(SymbolID id,
boolean all)
Return whether this class has the specified parent interface. |
abstract boolean |
hasStaticMethod(boolean all)
Return whether any of the methods are static methods. |
abstract boolean |
isAbstract()
Return whether this object contains any abstract methods. |
abstract boolean |
isInterface()
Return whether this object represents an interface or a class. |
Method |
lookupMethodByLongName(java.lang.String name,
boolean all)
Lookup the specified method by long method name. |
java.util.Collection |
lookupMethodByShortName(java.lang.String name,
boolean all)
Lookup the specified method by short method name, returning the associated collection of methods, if found; otherwise, return null. |
Methods inherited from class gov.llnl.babel.symbols.Symbol |
addMetadata, getComment, getFullName, getMetadata, getSymbolID, getSymbolType, getSymbolTypeString, setComment |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Extendable(SymbolID id, int type, Comment comment)
Extendable
object that will be constructed
by calls to other member functions.
public Extendable(SymbolID id, int type, Comment comment, Metadata m)
Extendable
object that will be constructed
by calls to other member functions.
Method Detail |
public abstract boolean isAbstract()
public abstract boolean isInterface()
public void addMethod(Method method)
public java.util.Collection getMethods(boolean all)
Collection
.
If the boolean argument is true, then all methods are returned;
otherwise, only locally defined methods are returned. Each element
in the collection is of type Method
.
public java.util.Collection getNonstaticMethods(boolean all)
Collection
. If the boolean argument is true, then all
non-static methods are returned; otherwise, only locally defined non-
static methods are returned. Each element in the collection is of
type Method
.
public java.util.Collection getStaticMethods(boolean all)
Collection
.
If the boolean argument is true, then all static methods are returned;
otherwise, only locally defined static methods are returned. Each
element in the collection is of type Method
.
public java.util.Collection getAbstractMethods()
Method
.
public Method lookupMethodByLongName(java.lang.String name, boolean all)
public java.util.Collection lookupMethodByShortName(java.lang.String name, boolean all)
public boolean hasMethodByLongName(java.lang.String name, boolean all)
public boolean hasMethodByShortName(java.lang.String name, boolean all)
public abstract boolean hasStaticMethod(boolean all)
public boolean hasExceptionThrowingMethod(boolean all)
public abstract void addParentInterface(Interface parent)
Class
and Interface
subclasses.
public java.util.Collection getParentInterfaces(boolean all)
Collection
. Each
member of the collection is an Interface
. If the
boolean argument is true, then return all parents; otherwise, return
only direct parents.
public boolean hasParentInterface(SymbolID id, boolean all)
public java.util.Set getSymbolReferences()
SymbolID
.
getSymbolReferences
in class Symbol
public java.util.Set getAllSymbolReferences()
Symbol
getAllSymbolReferences
in class Symbol
public java.util.Set getBasicArrayRefs()
getBasicArrayRefs
in class Symbol
protected void addParentData(Extendable ext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |