org.extex.typesetter.type.noad
Class MathList

java.lang.Object
  extended by org.extex.typesetter.type.noad.AbstractNoad
      extended by org.extex.typesetter.type.noad.MathList
All Implemented Interfaces:
Noad

public class MathList
extends AbstractNoad

This class provides a container for Noads and Nodes.

Version:
$Revision: 4739 $
Author:
Gerd Neugebauer
See Also:
"TTP [???]"

Constructor Summary
MathList()
          Creates a new object without any items.
 
Method Summary
 void add(Noad noad)
          Add an arbitrary knot to the list.
 boolean empty()
          Test whether the node list is empty.
 Noad get(int index)
          Getter for a node at a given position.
 Noad getLastNoad()
          Getter for the last noad previously stored.
 Noad remove(int index)
          Remove an element at a given position.
 int size()
          Return the size of the MathList.
 java.lang.String toString()
          Get the string representation of this object for debugging purposes.
 void toString(java.lang.StringBuffer sb)
          Produce a printable representation of the noad in a StringBuffer.
 void toString(java.lang.StringBuffer sb, int depth)
          Produce a printable representation to a certain depth of the noad.
 void typeset(Noad previousNoad, NoadList noads, int index, NodeList list, MathContext mathContext, java.util.logging.Logger logger)
          Translate a Noad into a NodeList.
 
Methods inherited from class org.extex.typesetter.type.noad.AbstractNoad
getLocalizer, getSpacingClass, getSubscript, getSuperscript, makeScripts, rebox, setSpacingClass, setSubscript, setSuperscript, toStringAdd, toStringSubsidiaray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MathList

public MathList()
Creates a new object without any items.

Method Detail

add

public void add(Noad noad)
Add an arbitrary knot to the list.

Parameters:
noad - the noad to add

empty

public boolean empty()
Test whether the node list is empty.

Returns:
true, if the list is empty, otherwise false.

get

public Noad get(int index)
Getter for a node at a given position.

Parameters:
index - the position
Returns:
the node at position index of null if index is out of bounds

getLastNoad

public Noad getLastNoad()
Getter for the last noad previously stored.

Returns:
the last noad or null if none is available

remove

public Noad remove(int index)
Remove an element at a given position.

Parameters:
index - the position
Returns:
the element previously located at position index

size

public int size()
Return the size of the MathList.

Returns:
the size of the MathList

toString

public java.lang.String toString()
Get the string representation of this object for debugging purposes.

Overrides:
toString in class AbstractNoad
Returns:
the string representation
See Also:
Object.toString()

toString

public void toString(java.lang.StringBuffer sb)
Produce a printable representation of the noad in a StringBuffer.

Specified by:
toString in interface Noad
Overrides:
toString in class AbstractNoad
Parameters:
sb - the string buffer
See Also:
Noad.toString( java.lang.StringBuffer)

toString

public void toString(java.lang.StringBuffer sb,
                     int depth)
Produce a printable representation to a certain depth of the noad.

Specified by:
toString in interface Noad
Overrides:
toString in class AbstractNoad
Parameters:
sb - the string buffer
depth - the depth to which the full information should be given
See Also:
Noad.toString( java.lang.StringBuffer, int)

typeset

public void typeset(Noad previousNoad,
                    NoadList noads,
                    int index,
                    NodeList list,
                    MathContext mathContext,
                    java.util.logging.Logger logger)
             throws TypesetterException,
                    ConfigurationException
Translate a Noad into a NodeList.

Parameters:
previousNoad - the previous noad
noads - the list of noads currently processed
index - the index of the current node in the list
list - the list to add the nodes to. This list contains the Nodes previously typeset. Thus it can be used to look back
mathContext - the context to consider
logger - the logger for debugging and tracing information
Throws:
TypesetterException - in case of a problem
ConfigurationException - in case of a configuration problem
See Also:
Noad.typeset( org.extex.typesetter.type.noad.Noad, org.extex.typesetter.type.noad.NoadList, int, org.extex.typesetter.type.NodeList, org.extex.typesetter.type.noad.util.MathContext, java.util.logging.Logger)