de.projectory.koivima.core
Class AbstractElementList

java.lang.Object
  extended by de.projectory.koivima.core.Element
      extended by de.projectory.koivima.core.AbstractElementList
All Implemented Interfaces:
java.lang.Iterable<Element>
Direct Known Subclasses:
CodeBlock, ElementList

public abstract class AbstractElementList
extends Element
implements java.lang.Iterable<Element>

A list of executable Elements that is itself an element.


Field Summary
protected  java.util.ArrayList<Element> code
          A list that contains the elements
 
Fields inherited from class de.projectory.koivima.core.Element
context
 
Constructor Summary
AbstractElementList()
          Creates a new code block, that can be executed in the specified ExecutionContext If this code block is not inserted into another code block for execution purpose, than setExecutionContext must be called.
 
Method Summary
abstract  void add(Element element)
          Adds an element to the end of this list.
abstract  void addFirst(Element element)
          Adds an element to the beginning of this list.
 void execute()
          Overwrite execute in element.
 java.util.Iterator<Element> iterator()
           
 void setExecutionContext(ExecutionContext context)
          Overwrites setExecutionContext of Element
 
Methods inherited from class de.projectory.koivima.core.Element
getExecutionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code

protected java.util.ArrayList<Element> code
A list that contains the elements

Constructor Detail

AbstractElementList

public AbstractElementList()
Creates a new code block, that can be executed in the specified ExecutionContext If this code block is not inserted into another code block for execution purpose, than setExecutionContext must be called.

Method Detail

setExecutionContext

public void setExecutionContext(ExecutionContext context)
Overwrites setExecutionContext of Element

Overrides:
setExecutionContext in class Element
Parameters:
context - ExecutionContext for this CodeBlock.

execute

public void execute()
Overwrite execute in element. Just puts this class onto the stack.

Specified by:
execute in class Element

add

public abstract void add(Element element)
Adds an element to the end of this list.

Parameters:
element - A code element: data element, operator or other

addFirst

public abstract void addFirst(Element element)
Adds an element to the beginning of this list.

Parameters:
element - A code element: data element, operator or other

iterator

public java.util.Iterator<Element> iterator()
Specified by:
iterator in interface java.lang.Iterable<Element>