de.dante.extex.typesetter.type.node
Class DiscretionaryNode

java.lang.Object
  extended byde.dante.extex.typesetter.type.node.AbstractNode
      extended byde.dante.extex.typesetter.type.node.DiscretionaryNode
All Implemented Interfaces:
Node, java.io.Serializable

public class DiscretionaryNode
extends AbstractNode
implements Node

This node represents a glyph which can be broken if required.

Version:
$Revision: 1.15 $
Author:
Gerd Neugebauer, Michael Niedermair
See Also:
"TeX – The Program [145]", Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Fields inherited from class de.dante.extex.typesetter.type.node.AbstractNode
NO_CHARS
 
Constructor Summary
DiscretionaryNode(NodeList pre, NodeList post, NodeList no)
          Creates a new object.
 
Method Summary
 NodeList getNoBreak()
          Getter for noBreak.
 NodeList getPostBreak()
          Getter for postBreak.
 NodeList getPreBreak()
          Getter for preBreak.
 void toString(java.lang.StringBuffer sb, java.lang.String prefix, int breadth, int depth)
          This method returns the printable representation.
 void toText(java.lang.StringBuffer sb, java.lang.String prefix)
          This method puts the printable representation into the string buffer.
 java.lang.Object visit(NodeVisitor visitor, java.lang.Object value)
          This method provides an entry point for the visitor pattern.
 
Methods inherited from class de.dante.extex.typesetter.type.node.AbstractNode
addDepthTo, addHeightTo, addWidthTo, advanceDepth, advanceHeight, advanceWidth, atShipping, computeAdjustment, countChars, getChars, getDepth, getHeight, getLocalizer, getVerticalSize, getWidth, maxDepth, maxHeight, maxWidth, setDepth, setHeight, setWidth, spreadHeight, spreadWidth, toString, toText
 
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.Node
addDepthTo, addHeightTo, addWidthTo, atShipping, countChars, getChars, getDepth, getHeight, getVerticalSize, getWidth, setDepth, setHeight, setWidth, spreadHeight, spreadWidth
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail

DiscretionaryNode

public DiscretionaryNode(NodeList pre,
                         NodeList post,
                         NodeList no)
Creates a new object.

Parameters:
pre - the Tokens to be inserted at the end of the line in case of a line breaking at this position.
post - the Tokens to be inserted at the beginning of th next line in case of a line breaking at this position.
no - the Tokens to be inserted in case of no line breaking at this position.
Method Detail

getNoBreak

public NodeList getNoBreak()
Getter for noBreak.

Returns:
the noBreak.

getPostBreak

public NodeList getPostBreak()
Getter for postBreak.

Returns:
the postBreak.

getPreBreak

public NodeList getPreBreak()
Getter for preBreak.

Returns:
the preBreak.

toString

public void toString(java.lang.StringBuffer sb,
                     java.lang.String prefix,
                     int breadth,
                     int depth)
This method returns the printable representation. This is meant to produce a exhaustive form as it is used in tracing output to the log file.

Specified by:
toString in interface Node
Overrides:
toString in class AbstractNode
Parameters:
sb - the target buffer
prefix - the prefix for each new line
breadth - the breadth
depth - the depth
See Also:
"TeX – The Program [195]", Node.toString( java.lang.StringBuffer, java.lang.String, int, int)

toText

public void toText(java.lang.StringBuffer sb,
                   java.lang.String prefix)
Description copied from interface: Node
This method puts the printable representation into the string buffer. This is meant to produce a short form only as it is used in error messages to the user.

Specified by:
toText in interface Node
Overrides:
toText in class AbstractNode
Parameters:
sb - the output string buffer
prefix - the string prepended to each line of the resulting text
See Also:
Node.toText( java.lang.StringBuffer, java.lang.String)

visit

public java.lang.Object visit(NodeVisitor visitor,
                              java.lang.Object value)
                       throws GeneralException
Description copied from interface: Node
This method provides an entry point for the visitor pattern.

Specified by:
visit in interface Node
Parameters:
visitor - the visitor to apply
value - the argument for the visitor
Returns:
the result of the method invocation of the visitor
Throws:
GeneralException - in case of an error
See Also:
Node.visit( de.dante.extex.typesetter.type.NodeVisitor, java.lang.Object)