public class DeclarationBlock extends Declaration implements IDeclarationBlock
IDeclarationBlock
.Modifier and Type | Field and Description |
---|---|
static IDeclarationBlock |
EMPTY |
Constructor and Description |
---|
DeclarationBlock(java.lang.Object declarationContext) |
DeclarationBlock(java.lang.Object declarationContext,
IDeclaration[] declarations) |
Modifier and Type | Method and Description |
---|---|
IFunctorCall |
accept(IFunctorCall call)
Apply this declaration to
call . |
void |
addDeclaration(IDeclaration declaration) |
IDeclaration[] |
getDeclarations()
The array of
IDeclaration instances in this block. |
boolean |
isBlock()
true if this declaration has child elements itself. |
boolean |
removeDeclaration(IDeclaration declaration) |
int |
size()
The number of declarations in this block.
|
getDeclarationContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDeclarationContext
public static final IDeclarationBlock EMPTY
public DeclarationBlock(java.lang.Object declarationContext)
public DeclarationBlock(java.lang.Object declarationContext, IDeclaration[] declarations)
public IFunctorCall accept(IFunctorCall call) throws DeclarationException
IDeclaration
call
.
The semantics of this method is up to the designer.
accept
in interface IDeclaration
call
- The IFunctorCall
to be modified.IFunctorCall
.DeclarationException
public void addDeclaration(IDeclaration declaration)
public IDeclaration[] getDeclarations()
IDeclarationBlock
IDeclaration
instances in this block.getDeclarations
in interface IDeclarationBlock
IDeclaration
instances in this block.public boolean isBlock()
IDeclaration
true
if this declaration has child elements itself.
A IDeclarationElement
may be a IDeclarationBlock
,
supporting nested declarations. You should not use "instanceof
IDeclarationBlock" to check this behavior but this method.
isBlock
in interface IDeclaration
isBlock
in class Declaration
true
if this declaration has child elements
itself.public boolean removeDeclaration(IDeclaration declaration)
public int size()
IDeclarationBlock
size
in interface IDeclarationBlock