intarsys runtime library

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 Object
implements IDeclarationBlock

Helper implementation for an empty declaration block.


Constructor Summary
EmptyDeclarationBlock()
           
 
Method Summary
 void addDeclarationElement(IDeclarationElement declaration)
          Add an IDeclarationElement to this block;
 void clear()
          Remove all IDeclarationElement instances from this block;
 IDeclaration copy()
          Create a copy of this.
 Object getDeclarationContext()
          An optional declaration context.
 IDeclarationElement getDeclarationElement(String name)
          The IDeclarationElement for the given name.
 IDeclarationElement[] getDeclarationElements()
          The array of IDeclarationElement instances in this block.
 boolean isBlock()
          true if this declaration has child elements itself.
 void moveDown(IDeclarationElement declaration)
          Move element to the position after its current position.
 void moveUp(IDeclarationElement declaration)
          Move element to the position before its current position.
 boolean removeDeclarationElement(IDeclarationElement declaration)
          Remove an IDeclarationElement from this block;
 int size()
          The number of declarations in this block.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyDeclarationBlock

public EmptyDeclarationBlock()
Method Detail

addDeclarationElement

public void addDeclarationElement(IDeclarationElement declaration)
Description copied from interface: IDeclarationBlock
Add an IDeclarationElement to this block;

Specified by:
addDeclarationElement in interface IDeclarationBlock

clear

public void clear()
Description copied from interface: IDeclarationBlock
Remove all IDeclarationElement instances from this block;

Specified by:
clear in interface IDeclarationBlock

copy

public IDeclaration copy()
Description copied from interface: IDeclaration
Create a copy of this.

Specified by:
copy in interface IDeclaration
Returns:
A copy of this.

getDeclarationContext

public 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.

getDeclarationElement

public IDeclarationElement getDeclarationElement(String name)
Description copied from interface: IDeclarationBlock
The IDeclarationElement for the given name.

Specified by:
getDeclarationElement in interface IDeclarationBlock
Returns:
The IDeclarationElement for the given name.

getDeclarationElements

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

Specified by:
getDeclarationElements in interface IDeclarationBlock
Returns:
The array of IDeclarationElement 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.

moveDown

public void moveDown(IDeclarationElement declaration)
Description copied from interface: IDeclarationBlock
Move element to the position after its current position. This means that the element declaration will be performed later.

If the element is the last declaration or not contained in the block this method does nothing.

Specified by:
moveDown in interface IDeclarationBlock

moveUp

public void moveUp(IDeclarationElement declaration)
Description copied from interface: IDeclarationBlock
Move element to the position before its current position. This means that the element declaration will be performed earlier.

If the element is the first declaration or not contained in the block this method does nothing.

Specified by:
moveUp in interface IDeclarationBlock

removeDeclarationElement

public boolean removeDeclarationElement(IDeclarationElement declaration)
Description copied from interface: IDeclarationBlock
Remove an IDeclarationElement from this block;

Specified by:
removeDeclarationElement in interface IDeclarationBlock
Returns:
true if declaration was removed

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.

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.