ConForM.CoopnTools.CoKer.CoalaMgr
Class CoalaElementList

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.CoalaMgr.CoalaElement
        |
        +--ConForM.CoopnTools.CoKer.CoalaMgr.CoalaElementList
All Implemented Interfaces:
java.lang.Cloneable, CoopnSyntacticElement, java.io.Serializable
Direct Known Subclasses:
CoalaExceptionAgg, CoalaHandlerList, CoalaModuleNameList, CoalaRoleList, CoalaSymbolList

public abstract class CoalaElementList
extends CoalaElement

Coala elements. This abstract class essentially defines lists of coala elements, i.e. elements of the abstract syntax. This class must be extended by defining an empty constructor and methods for adding,merging and retrieving the elements of the list; these methods must be based on the two protected methods "addElement", "mergeElementList" and "getElement". Lists of elements are themselves elements; therefore, this class extends "CoalaElement". However, the management of lists is generic, and this class actually implements the abstract methods of class "CoalaElement", except the methods for converting the list into strings.

See Also:
CoalaElement, Serialized Form

Constructor Summary
CoalaElementList()
           
 
Method Summary
 void addElement(CoalaElement elem)
          Addition of a textual element into the list.
 java.lang.Object clone()
          Cloning method.
 boolean contains(CoalaElement elem)
          Look if an element is in the list.
 boolean empty()
          Test the list for being empty.
 boolean equals(java.lang.Object obj)
          Equality method.
 CoalaElement[] getElements()
          Get the elements of a list.
 int hashCode()
          Hashcode method.
 void mergeElementList(CoalaElementList merge)
          Merging of two lists of elements.
 int size()
          Get the size of the list.
 
Methods inherited from class ConForM.CoopnTools.CoKer.CoalaMgr.CoalaElement
cloneCoalaElement, toCompleteString, toCompleteString, toCompleteString, toCompleteString, toCompleteString, toCompleteString, toCompleteText, toCompleteText, toString, toString, toString, toText
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoalaElementList

public CoalaElementList()
Method Detail

addElement

public void addElement(CoalaElement elem)
Addition of a textual element into the list. This method must be used by the actual lists for achieving their goal.
Parameters:
elem - the element to add

mergeElementList

public void mergeElementList(CoalaElementList merge)
Merging of two lists of elements. This method must be used by the actual lists for achieving their goal.
Parameters:
merge - the list to add

getElements

public CoalaElement[] getElements()
Get the elements of a list. This method must be used by the actual lists for achieving their goal.
Returns:
an array of elements

contains

public boolean contains(CoalaElement elem)
Look if an element is in the list.
Parameters:
elem - the element of look in the list
Returns:
true iff the lement is in the list.

empty

public boolean empty()
Test the list for being empty.
Returns:
true iff the list is empty

size

public int size()
Get the size of the list.
Returns:
the size of the list

equals

public boolean equals(java.lang.Object obj)
Equality method. Implements the equality between lists.
Overrides:
equals in class CoalaElement
Parameters:
obj - the object to compare
Returns:
true iff this object and the parameter are equals.

hashCode

public int hashCode()
Description copied from class: CoalaElement
Hashcode method. Must be defined in the inherited classes.
Overrides:
hashCode in class CoalaElement
Following copied from class: ConForM.CoopnTools.CoKer.CoalaMgr.CoalaElement
Returns:
the hash code.

clone

public java.lang.Object clone()
Cloning method. Implements the cloning method.
Overrides:
clone in class CoalaElement
Returns:
a clone object.