org.extex.typesetter.type.node
Class MarkNode

java.lang.Object
  extended by org.extex.typesetter.type.node.AbstractNode
      extended by org.extex.typesetter.type.node.MarkNode
All Implemented Interfaces:
java.io.Serializable, Node

public class MarkNode
extends AbstractNode
implements Node

A mark node carries some tokens which can be extracted after the page has been completed. It can be used extract the first and last mark for headlines.

The document writer should ignore mark nodes.

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

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Fields inherited from class org.extex.typesetter.type.node.AbstractNode
NO_CHARS
 
Constructor Summary
MarkNode(Tokens mark, java.lang.String index)
          Creates a new object.
 
Method Summary
 Node atShipping(PageContext context, Typesetter typesetter, FixedDimen posX, FixedDimen posY)
          This method performs any action which are required to executed at the time of shipping the node to the DocumentWriter. It is a NOOP in the abstract base class and should be overwritten by sub-classes if required.
 java.lang.String getIndex()
          Getter for index.
 Tokens getMark()
          Getter for mark.
 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)
          Puts a text representation of the object into a 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 org.extex.typesetter.type.node.AbstractNode
addDepthTo, addHeightTo, addWidthTo, advanceNaturalDepth, advanceNaturalHeight, advanceNaturalWidth, clone, computeAdjustment, countChars, getChars, getDepth, getHeight, getLocalizer, getNaturalDepth, getNaturalHeight, getNaturalWidth, getVerticalSize, getWidth, maxDepth, maxHeight, maxWidth, setDepth, setHeight, setWidth, spreadHeight, spreadWidth, toString, toText
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.extex.typesetter.type.Node
addDepthTo, addHeightTo, addWidthTo, countChars, getChars, getDepth, getHeight, getNaturalDepth, getNaturalHeight, getNaturalWidth, 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

MarkNode

public MarkNode(Tokens mark,
                java.lang.String index)
Creates a new object.

Parameters:
mark - the mark tokens to store
index - the index of the mark
Method Detail

atShipping

public Node atShipping(PageContext context,
                       Typesetter typesetter,
                       FixedDimen posX,
                       FixedDimen posY)
                throws GeneralException
This method performs any action which are required to executed at the time of shipping the node to the DocumentWriter. It is a NOOP in the abstract base class and should be overwritten by sub-classes if required.

Specified by:
atShipping in interface Node
Overrides:
atShipping in class AbstractNode
Parameters:
context - the interpreter context encapsulated as page context
typesetter - the typesetter
posX - the horizontal position on the page
posY - the vertical position on the page
Returns:
the node to be used instead of the current one in the output list. If the value is null then the node is deleted. If the value is the node itself then it is preserved.
Throws:
GeneralException - in case of an error
See Also:
AbstractNode.atShipping( org.extex.typesetter.PageContext, org.extex.typesetter.Typesetter, org.extex.core.dimen.FixedDimen, org.extex.core.dimen.FixedDimen)

getIndex

public java.lang.String getIndex()
Getter for index.

Returns:
the index.

getMark

public Tokens getMark()
Getter for mark.

Returns:
the mark.

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 output string buffer
prefix - the prefix string inserted at the beginning of each line
breadth - the breadth
depth - the depth
See Also:
"TeX – The Program [196]", Node.toString( java.lang.StringBuffer, java.lang.String, int, int)

toText

public void toText(java.lang.StringBuffer sb,
                   java.lang.String prefix)
Puts a text representation of the object into a string buffer.

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
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( org.extex.typesetter.type.NodeVisitor, java.lang.Object)