gov.llnl.babel.symbols
Class Interface

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.Extendable
                  extended by gov.llnl.babel.symbols.Interface
All Implemented Interfaces:
Attributes, IMetadata, java.lang.Cloneable, java.lang.Comparable

public class Interface
extends Extendable

Class Interface defines a sidl interface. All the basic functionality for this class is implemented by the parent extendable class.


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
Interface(SymbolID id, Comment comment, Context context)
          Create an empty Interface object that will be constructed by calls to other member functions.
Interface(SymbolID id, Comment comment, Metadata metadata, Context context)
          Create an empty Interface object that will be constructed by calls to other member functions.
 
Method Summary
 void addParentInterface(Interface parent)
          Add a parent interface to this interface.
 Class generateAnonymousClass()
          generateAnonymousClass generates the anonymous class for this Interface.
 int getDepth()
          Return how many levels of refinement this type is from a basic type.
 boolean hasStaticMethod(boolean all)
          Return whether this interface has any static methods (always false).
 boolean isAbstract()
          Return whether this interface is abstract.
 boolean isInterface()
          Return whether this object represents an interface (true).
 
Methods inherited from class gov.llnl.babel.symbols.Extendable
addInvAssertion, addMethod, addParentData, addRenamedMethod, freeze, getAbstractAndLocalMethods, getAbstractMethods, getAllInvAssertions, getAllParentsInOrder, getAllPostAssertions, getAllPreAssertions, getAllSymbolReferences, getBasicArrayRefs, getInvClause, getInvClause, getInvDefaultComplexity, getMethods, getMethodsWithNonblocking, getNewMethod, getNewMethods, getNonstaticMethods, getNumberOfMethods, getObjectDependencies, getOverloadedMethodsByName, getParentInterface, getParentInterfaces, getParents, getRenamedMethod, getRenamedMethods, getRenamedMethodSymbolID, getStaticMethods, getSymbolReferences, getTotalContractAssertions, getTotalInvAssertions, getTotalPostAssertions, getTotalPreAssertions, hasAncestor, hasBuiltinMethodAssertion, hasContracts, hasExceptionThrowingMethod, hasInvClause, hasMethodByLongName, hasMethodByShortName, hasParentInterface, hasParentInterfaces, hasPostconditions, hasPreconditions, invHasMethodCall, invHasResultOrArg, isLocal, lookupMethodByLongName, lookupMethodByShortName, methodWasRenamed, validateContracts, validateInvClause, validatePostClause, validatePostClause, validatePostClause, validatePreClause, validatePreClause, validatePreClause
 
Methods inherited from class gov.llnl.babel.symbols.Symbol
addMetadata, getAttribute, getAttributes, getComment, getMetadata, getSymbolID, getSymbolType, getSymbolTypeString, getUserSpecified, hasAttribute, isClass, 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, isSymbolBindC, 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

Interface

public Interface(SymbolID id,
                 Comment comment,
                 Context context)
Create an empty Interface object that will be constructed by calls to other member functions.


Interface

public Interface(SymbolID id,
                 Comment comment,
                 Metadata metadata,
                 Context context)
Create an empty Interface object that will be constructed by calls to other member functions.

Method Detail

isAbstract

public boolean isAbstract()
Return whether this interface is abstract. An interface is always abstract, even if it contains no methods.

Specified by:
isAbstract in class Extendable

isInterface

public boolean isInterface()
Return whether this object represents an interface (true).

Specified by:
isInterface in class Extendable

hasStaticMethod

public boolean hasStaticMethod(boolean all)
Return whether this interface has any static methods (always false).

Specified by:
hasStaticMethod in class Extendable
Parameters:
all - If TRUE, then local and parent methods are to be searched; otherwise, only local methods are to be searched.

addParentInterface

public void addParentInterface(Interface parent)
Add a parent interface to this interface. This method does not check that the interfaces and methods are compatible; it simply copies the methods and interface parents and adds them to this interface.

Specified by:
addParentInterface in class Extendable
Parameters:
parent - The parent interface to be added to this object.

generateAnonymousClass

public Class generateAnonymousClass()
                             throws CodeGenerationException
generateAnonymousClass generates the anonymous class for this Interface. This anonymous class is only used to connect an interface remotely.

Throws:
CodeGenerationException

getDepth

public int getDepth()
Description copied from class: Symbol
Return how many levels of refinement this type is from a basic type. For enumerations and packages, this returns zero. For classes, it returns the distance from sidl.BaseClass. For interfaces, it returns the distance from sidl.BaseInterface.

Overrides:
getDepth in class Symbol