ConForM.CoopnTools.CoKer.CoalaMgr
Class CoalaElement

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.CoalaMgr.CoalaElement
All Implemented Interfaces:
java.lang.Cloneable, CoopnSyntacticElement, java.io.Serializable
Direct Known Subclasses:
CoalaElementList, CoalaException, CoalaHandler, CoalaHandlerTerm, CoalaInstruction, CoalaModule, CoalaModuleName, CoalaName, CoalaRole, CoalaRoleTerm, CoalaSection, CoalaSymbol

public abstract class CoalaElement
extends java.lang.Object
implements CoopnSyntacticElement

Coala elements. This abstract class essentially defines basic elements of the coala asbtract syntax. This class must de extended in immutable classes, by defining "equals", "toText", "toCompleteText", "toCoco" and "clone" methods. In addition, for each textual attribute attr_i of type Attr_i, a private attribute variable must be defined, a constructor with parameters "(Attr_1 attr_1, ... , Attr_n attr_n)" must be defined, and n methods "Attr_i attr_i()" returning the value of the attribute must be defined.

See Also:
Serialized Form

Constructor Summary
CoalaElement()
           
 
Method Summary
abstract  java.lang.Object clone()
          Cloning method.
protected  CoalaElement cloneCoalaElement()
          Internal cloning method.
abstract  boolean equals(java.lang.Object obj)
          Equality method.
abstract  int hashCode()
          Hashcode method.
 java.lang.String toCompleteString()
          Complete string method.
 java.lang.String toCompleteString(CoopnEnv env)
          Complete string conversion method.
 java.lang.String toCompleteString(CoopnEnv env, int indent)
          Complete string conversion method.
 java.lang.String toCompleteString(CoopnSymbolTable table)
          Complete string method.
 java.lang.String toCompleteString(CoopnSymbolTable table, CoopnEnv env)
          Complete string conversion method.
 java.lang.String toCompleteString(CoopnSymbolTable table, CoopnEnv env, int indent)
          Complete string conversion method.
 ConForM.CoopnTools.CoKer.CoalaMgr.CoalaTextMgr.CoalaTextElement toCompleteText()
          Complete textual elements conversion method.
abstract  ConForM.CoopnTools.CoKer.CoalaMgr.CoalaTextMgr.CoalaTextElement toCompleteText(CoopnSymbolTable table)
          Complete textual elements conversion method.
 java.lang.String toString()
          String conversion method.
 java.lang.String toString(CoopnEnv env)
          String conversion method.
 java.lang.String toString(CoopnEnv env, int indent)
          String conversion method.
abstract  ConForM.CoopnTools.CoKer.CoalaMgr.CoalaTextMgr.CoalaTextElement toText()
          Textual elements conversion method.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoalaElement

public CoalaElement()
Method Detail

equals

public abstract boolean equals(java.lang.Object obj)
Equality method. Must be defined in the inherited classes.
Specified by:
equals in interface CoopnSyntacticElement
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare
Returns:
true iff this object and the parameter are equals.

hashCode

public abstract int hashCode()
Hashcode method. Must be defined in the inherited classes.
Specified by:
hashCode in interface CoopnSyntacticElement
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code.

toText

public abstract ConForM.CoopnTools.CoKer.CoalaMgr.CoalaTextMgr.CoalaTextElement toText()
Textual elements conversion method. Must be defined in the inherited classes. This routine converts an element into a user-friendly textual element representing it. The string interpretation of this element is very intuitive by a user, but may be incorrect in the sense that it may be rejected by a checker.
Returns:
a CoopnTextElement image.

toCompleteText

public abstract ConForM.CoopnTools.CoKer.CoalaMgr.CoalaTextMgr.CoalaTextElement toCompleteText(CoopnSymbolTable table)
Complete textual elements conversion method. Must be defined in the inherited classes. This routine converts an element into a correct textual element representing it. The string interpretation of this element will be accepted by a checker, but may be difficult to read by users, due to the additionnal information, like parenthesis and so on.
Parameters:
table - the symbol table used to generate symbol references
Returns:
a CoopnTextElement image.

toCompleteText

public ConForM.CoopnTools.CoKer.CoalaMgr.CoalaTextMgr.CoalaTextElement toCompleteText()
Complete textual elements conversion method. Must be defined in the inherited classes. This routine converts an element into a correct textual element representing it. The string interpretation of this element will be accepted by a checker, but may be difficult to read by users, due to the additionnal information, like parenthesis and so on.
Returns:
a CoopnTextElement image.

toString

public java.lang.String toString(CoopnEnv env,
                                 int indent)
String conversion method. This routine converts an element into a string representing it, by transforming it using toText.
Specified by:
toString in interface CoopnSyntacticElement
Parameters:
env - the environment deciding the form of the display
indent - the identation factor
Returns:
a String image of the element.

toString

public java.lang.String toString(CoopnEnv env)
String conversion method. Use an identation of 0. This routine converts an element into a string representing it, by transforming it using toText.
Specified by:
toString in interface CoopnSyntacticElement
Parameters:
env - the environment deciding the form of the display
Returns:
a String image of the element.

toString

public java.lang.String toString()
String conversion method. Use no environment and an identation of 0. This routine converts an element into a string representing it, by transforming it using toText.
Specified by:
toString in interface CoopnSyntacticElement
Overrides:
toString in class java.lang.Object
Returns:
a String image of the element.

toCompleteString

public java.lang.String toCompleteString(CoopnSymbolTable table,
                                         CoopnEnv env,
                                         int indent)
Complete string conversion method. This routine converts an element into a string representing it, by transforming it using toText.
Parameters:
table - the symbol table used to generate symbol references
env - the environment deciding the form of the display
indent - the identation factor
Returns:
a String image of the element.

toCompleteString

public java.lang.String toCompleteString(CoopnSymbolTable table,
                                         CoopnEnv env)
Complete string conversion method. Use an identation of 0. This routine converts an element into a string representing it, by transforming it using toText.
Parameters:
table - the symbol table used to generate symbol references
env - the environment deciding the form of the display
Returns:
a String image of the element.

toCompleteString

public java.lang.String toCompleteString(CoopnSymbolTable table)
Complete string method. Use no environment and an identation of 0. This routine converts an element into a string representing it, by transforming it using toText.
Parameters:
table - the symbol table used to generate symbol references
Returns:
a String image of the element.

toCompleteString

public java.lang.String toCompleteString(CoopnEnv env,
                                         int indent)
Complete string conversion method. This routine converts an element into a string representing it, by transforming it using toText.
Specified by:
toCompleteString in interface CoopnSyntacticElement
Parameters:
env - the environment deciding the form of the display
indent - the identation factor
Returns:
a String image of the element.

toCompleteString

public java.lang.String toCompleteString(CoopnEnv env)
Complete string conversion method. Use an identation of 0. This routine converts an element into a string representing it, by transforming it using toText.
Specified by:
toCompleteString in interface CoopnSyntacticElement
Parameters:
env - the environment deciding the form of the display
Returns:
a String image of the element.

toCompleteString

public java.lang.String toCompleteString()
Complete string method. Use no environment and an identation of 0. This routine converts an element into a string representing it, by transforming it using toText.
Specified by:
toCompleteString in interface CoopnSyntacticElement
Returns:
a String image of the element.

cloneCoalaElement

protected CoalaElement cloneCoalaElement()
Internal cloning method. Should be used by the inherited classed for implementing their own "clone" method.
Returns:
a clone element.

clone

public abstract java.lang.Object clone()
Cloning method. Must be defined in the inherited classes.
Specified by:
clone in interface CoopnSyntacticElement
Overrides:
clone in class java.lang.Object
Returns:
a clone object.