torero.model
Class Production.ProductionRHS

java.lang.Object
  |
  +--torero.model.Production.ProductionRHS
All Implemented Interfaces:
Serializable
Enclosing class:
Production

public class Production.ProductionRHS
extends Object
implements Serializable

Class for internal representation of the Right Hand Side (RHS) of the production.

See Also:
Serialized Form

Constructor Summary
Production.ProductionRHS(Iterator RHSSymbols)
           
 
Method Summary
 boolean equals(Object o)
          Overridden to define to RHS's equal when they have exactly the same order of the same Symbols.
 void flipSymbols(int posA, int posB)
          Changes the places of the symbols on the given positions.
 Iterator getSymbols()
          Returns an Iterator of the ListElements the RHS is built off (from left to right).
 Enumeration getSymbolsEnum()
          Returns an Enumeration of the ListElements the RHS is built off (from left to right).
 int giveSymbolPosition(Production.ListElement elem)
          Returns the position of the given ListElement (if it doesn't contain such a list element - -1 is returned).
 void setSymbols(Iterator RHSSymbols)
          Set a new configuration of Symbols to this RHS.
 Production.ListElement symbolAt(int pos)
          Returns the Listelement on the given Position (if there is no ListElement on this pos - null is returned).
 int symbolSize()
          Returns the number of Symbols that the RHS has.
 String toDot(Derivat der, String offset, boolean withattribs)
          Support for Dot File generation.
 String toDotLabels(Derivat der, String offset)
          Support for Dot File generation.
 StringBuffer toOx(StringBuffer sb)
          Support for Ox File generation.
 String toString()
           
 String toString2()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Production.ProductionRHS

public Production.ProductionRHS(Iterator RHSSymbols)
Method Detail

getSymbols

public Iterator getSymbols()
Returns an Iterator of the ListElements the RHS is built off (from left to right).
Returns:
returns an Iterator of the ListElements the RHS is built off (from left to right).

getSymbolsEnum

public Enumeration getSymbolsEnum()
Returns an Enumeration of the ListElements the RHS is built off (from left to right).
Returns:
returns an Enumeration of the ListElements the RHS is built off (from left to right).

toOx

public StringBuffer toOx(StringBuffer sb)
Support for Ox File generation.

setSymbols

public void setSymbols(Iterator RHSSymbols)
Set a new configuration of Symbols to this RHS.
Parameters:
RHSSymbols - has to be an Iterator of Symbols.

flipSymbols

public void flipSymbols(int posA,
                        int posB)
Changes the places of the symbols on the given positions.

symbolSize

public int symbolSize()
Returns the number of Symbols that the RHS has.
Returns:
returns the number of Symbols the RHS has.

giveSymbolPosition

public int giveSymbolPosition(Production.ListElement elem)
Returns the position of the given ListElement (if it doesn't contain such a list element - -1 is returned).
Returns:
returns the position of the given ListElement (if it doesn't contain such a list element - -1 is returned).

symbolAt

public Production.ListElement symbolAt(int pos)
Returns the Listelement on the given Position (if there is no ListElement on this pos - null is returned).
Returns:
returns the Listelement on the given Position (if there is no ListElement on this pos - null is returned).

equals

public boolean equals(Object o)
Overridden to define to RHS's equal when they have exactly the same order of the same Symbols.
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

toString2

public String toString2()

toDot

public String toDot(Derivat der,
                    String offset,
                    boolean withattribs)
Support for Dot File generation.

toDotLabels

public String toDotLabels(Derivat der,
                          String offset)
Support for Dot File generation.