de.intarsys.tools.functor
Class EmptyDeclarationBlock

java.lang.Object
  extended by de.intarsys.tools.functor.EmptyDeclarationBlock
All Implemented Interfaces:
IDeclaration, IDeclarationBlock

public class EmptyDeclarationBlock
extends java.lang.Object
implements IDeclarationBlock

Helper implementation for an empty declaration block.


Constructor Summary
EmptyDeclarationBlock()
           
 
Method Summary
 IFunctorCall accept(IFunctorCall call)
          Apply this declaration to call.
 java.lang.Object getDeclarationContext()
          An optional declaration context.
 IDeclaration[] getDeclarations()
          The array of IDeclaration instances in this block.
 boolean isBlock()
          true if this declaration has child elements itself.
 int size()
          The number of declarations in this block.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyDeclarationBlock

public EmptyDeclarationBlock()
Method Detail

accept

public IFunctorCall accept(IFunctorCall call)
                    throws DeclarationException
Description copied from interface: IDeclaration
Apply this declaration to call.

The semantics of this method is up to the designer.

Specified by:
accept in interface IDeclaration
Parameters:
call - The IFunctorCall to be modified.
Returns:
The modified or new IFunctorCall.
Throws:
DeclarationException

getDeclarationContext

public java.lang.Object getDeclarationContext()
Description copied from interface: IDeclaration
An optional declaration context. This may be for example the object that will launch the IFunctorCall later and has parsed some declarations on startup.

Specified by:
getDeclarationContext in interface IDeclaration
Returns:
An optional declaration context.

getDeclarations

public IDeclaration[] getDeclarations()
Description copied from interface: IDeclarationBlock
The array of IDeclaration instances in this block.

Specified by:
getDeclarations in interface IDeclarationBlock
Returns:
The array of IDeclaration instances in this block.

isBlock

public boolean isBlock()
Description copied from interface: 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.

Specified by:
isBlock in interface IDeclaration
Returns:
true if this declaration has child elements itself.

size

public int size()
Description copied from interface: IDeclarationBlock
The number of declarations in this block.

Specified by:
size in interface IDeclarationBlock
Returns:
The number of declarations in this block.