de.dante.extex.typesetter.type.noad
Class AbstractNoad

java.lang.Object
  extended byde.dante.extex.typesetter.type.noad.AbstractNoad
All Implemented Interfaces:
Noad
Direct Known Subclasses:
AbstractNucleusNoad, CharNoad, FractionNoad, GlueNoad, KernNoad, LeftNoad, MathList, RightNoad

public abstract class AbstractNoad
extends java.lang.Object
implements Noad

This is the abstract base class for Noads. A Noad is the intermediate data structure which is used for processing mathematical material. Finally Noads are translated into Nodes. Thus Noad will never arrive at the DocumentWriter.

The Dimen Parameter \scriptspace

The dimen parameter \scriptspace contains the amount of spacing added to the width of subscripts.

Version:
$Revision: 1.22 $
Author:
Gerd Neugebauer

Constructor Summary
AbstractNoad()
          Creates a new object.
 
Method Summary
 Localizer getLocalizer()
          Getter for the localizer.
 MathSpacing getSpacingClass()
          Getter for spacingClass.
 Noad getSubscript()
          Getter for the subscript.
 Noad getSuperscript()
          Getter for the superscript.
protected  Node makeScripts(Node node, MathContext mc, FixedDimen delta, java.util.logging.Logger logger)
          Attach the subscripts and superscripts to the current hlist.
protected static Node rebox(Node node, Dimen width)
          Arrange that the node has exactly the width given and the old content is centered in it.
protected  void setSpacingClass(MathSpacing spacingClass)
          Setter for spacingClass.
 void setSubscript(Noad subscript)
          Setter for the subscript.
 void setSuperscript(Noad superscript)
          Setter for the superscript.
 java.lang.String toString()
           
 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.
protected  void toStringAdd(java.lang.StringBuffer sb, int depth)
          Add some information in the middle of the default toString method.
protected static void toStringSubsidiaray(java.lang.StringBuffer sb, Noad noad, int depth, java.lang.String prefix)
          Print a noad to the string buffer preceded by some prefix if the noad is not null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.dante.extex.typesetter.type.noad.Noad
typeset
 

Constructor Detail

AbstractNoad

public AbstractNoad()
Creates a new object.

Method Detail

rebox

protected static Node rebox(Node node,
                            Dimen width)
Arrange that the node has exactly the width given and the old content is centered in it. If the node is a box then this can be achieved by inserting the appropriate glue. Otherwise a new box has to be constructed.

Parameters:
node - the node to rebox
width - the target width
Returns:
...
See Also:
"TTP [715]"

toStringSubsidiaray

protected static void toStringSubsidiaray(java.lang.StringBuffer sb,
                                          Noad noad,
                                          int depth,
                                          java.lang.String prefix)
Print a noad to the string buffer preceded by some prefix if the noad is not null.

Parameters:
sb - the target buffer
noad - the noad to print
depth - the recursion depth
prefix - the prefix to print before the noad
See Also:
"TTP [692]"

getLocalizer

public Localizer getLocalizer()
Getter for the localizer.

Returns:
the localizer

getSpacingClass

public MathSpacing getSpacingClass()
Getter for spacingClass.

Specified by:
getSpacingClass in interface Noad
Returns:
the spacingClass

getSubscript

public Noad getSubscript()
Getter for the subscript.

Specified by:
getSubscript in interface Noad
Returns:
the subscript.

getSuperscript

public Noad getSuperscript()
Getter for the superscript.

Specified by:
getSuperscript in interface Noad
Returns:
the superscript.

makeScripts

protected Node makeScripts(Node node,
                           MathContext mc,
                           FixedDimen delta,
                           java.util.logging.Logger logger)
                    throws TypesetterException,
                           ConfigurationException
Attach the subscripts and superscripts to the current hlist.

Parameters:
node - the current node
mc - the math context
delta - superscript is delta to the right of the subscript if both are present
logger - the logger
Returns:
a node containing the node and the subscripts and superscripts. If no subscripts and superscripts are present then null is returned instead.
Throws:
TypesetterException - in case of an error
ConfigurationException - in case of an configuration error
See Also:
"TTP [756,757]"

setSpacingClass

protected void setSpacingClass(MathSpacing spacingClass)
Setter for spacingClass.

Parameters:
spacingClass - the spacingClass to set

setSubscript

public void setSubscript(Noad subscript)
Setter for the subscript.

Specified by:
setSubscript in interface Noad
Parameters:
subscript - the subscript to set.

setSuperscript

public void setSuperscript(Noad superscript)
Setter for the superscript.

Specified by:
setSuperscript in interface Noad
Parameters:
superscript - the superscript to set.

toString

public java.lang.String toString()
See Also:
Object.toString()

toString

public void toString(java.lang.StringBuffer sb)
Description copied from interface: Noad
Produce a printable representation of the noad in a StringBuffer.

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

toString

public void toString(java.lang.StringBuffer sb,
                     int depth)
Description copied from interface: Noad
Produce a printable representation to a certain depth of the noad.

Specified by:
toString in interface Noad
Parameters:
sb - the string buffer
depth - the depth to which the full information should be given
See Also:
"TTP [696]", Noad.toString( java.lang.StringBuffer, int)

toStringAdd

protected void toStringAdd(java.lang.StringBuffer sb,
                           int depth)
Add some information in the middle of the default toString method.

Parameters:
sb - the target string buffer
depth - the recursion depth