org.extex.typesetter.type.node
Class VerticalListNode

java.lang.Object
  extended by org.extex.typesetter.type.node.AbstractNode
      extended by org.extex.typesetter.type.node.GenericNodeList
          extended by org.extex.typesetter.type.node.VerticalListNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Node>, Node, NodeList, OrientedNode, OrientedNodeList

public class VerticalListNode
extends GenericNodeList
implements OrientedNodeList

This class provides an implementation for a vertical list.

Version:
$Revision: 4739 $
Author:
Gerd Neugebauer, Michael Niedermair
See Also:
"TeX – The Program [137]", 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
VerticalListNode()
          Creates a new empty list.
VerticalListNode(Node node)
          Creates a new list with a node in it.
 
Method Summary
 void add(int index, Node node)
          Add a node to the node list at a given position.
 void add(Node node)
          Add a node to the node list.
 void addSkip(FixedGlue glue)
          Add some glue to the node list.
protected  java.lang.Object clone()
          
 boolean isHorizontal()
          Check whether this node is in horizontal mode.
 boolean isTop()
          Getter for top.
 Node remove(int index)
          Remove an element at a given position.
 void setTop(boolean top)
          Setter for top.
 VerticalListNode split(FixedDimen height, java.util.logging.Logger logger, java.util.logging.Logger traceLogger)
          Split-off material from a vertical list of a desired height.
 long spread(FixedDimen height)
          Spread the list vertically to a desired size by distributing the differences to the glues contained.
 void toString(java.lang.StringBuffer sb, java.lang.String prefix, int breadth, int depth)
          This method puts the printable representation into the string buffer.
 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.
 long vpack(FixedDimen targetHeight)
          Adjust the variable nodes to achieve a given target height.
 
Methods inherited from class org.extex.typesetter.type.node.GenericNodeList
clear, copy, countChars, get, getChars, getDepth, getHeight, getMove, getNaturalDepth, getNaturalHeight, getShift, getTargetDepth, getTargetHeight, getTargetWidth, getWidth, isEmpty, iterator, setDepth, setHeight, setMove, setNaturalDepth, setNaturalHeight, setNaturalWidth, setShift, setTargetDepth, setTargetHeight, setTargetWidth, setWidth, size, toString, toText
 
Methods inherited from class org.extex.typesetter.type.node.AbstractNode
addDepthTo, addHeightTo, addWidthTo, advanceNaturalDepth, advanceNaturalHeight, advanceNaturalWidth, atShipping, computeAdjustment, getLocalizer, getNaturalWidth, getVerticalSize, maxDepth, maxHeight, maxWidth, spreadHeight, spreadWidth, 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.NodeList
clear, copy, get, getMove, getShift, isEmpty, iterator, setMove, setShift, size, toText
 
Methods inherited from interface org.extex.typesetter.type.Node
addDepthTo, addHeightTo, addWidthTo, atShipping, 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

VerticalListNode

public VerticalListNode()
Creates a new empty list.

See Also:
"TeX – The Program [136]"

VerticalListNode

public VerticalListNode(Node node)
Creates a new list with a node in it.

Parameters:
node - the initial node
Method Detail

add

public void add(int index,
                Node node)
Add a node to the node list at a given position.

Specified by:
add in interface NodeList
Overrides:
add in class GenericNodeList
Parameters:
index - the position of insertion
node - the node to add
See Also:
GenericNodeList.add( int, org.extex.typesetter.type.Node)

add

public void add(Node node)
Add a node to the node list. The other attributes (width, height, depth) are not modified.

Specified by:
add in interface NodeList
Overrides:
add in class GenericNodeList
Parameters:
node - the node to add
See Also:
GenericNodeList.add( org.extex.typesetter.type.Node)

addSkip

public void addSkip(FixedGlue glue)
Add some glue to the node list. The other attributes (width, height, depth) are not modified.

Specified by:
addSkip in interface NodeList
Overrides:
addSkip in class GenericNodeList
Parameters:
glue - the glue to add
See Also:
NodeList.addSkip( org.extex.core.glue.FixedGlue)

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException

Overrides:
clone in class GenericNodeList
Throws:
java.lang.CloneNotSupportedException
See Also:
GenericNodeList.clone()

isHorizontal

public boolean isHorizontal()
Check whether this node is in horizontal mode. Otherwise it is in vertical mode.

Specified by:
isHorizontal in interface OrientedNode
Returns:
the horizontal indicator
See Also:
OrientedNode.isHorizontal()

isTop

public boolean isTop()
Getter for top. The field top contains the indicator that the adjustment should use the reference point of the fist box. This is the mode for \vtop. In contrast the last box is used. This is the mode for \vbox.

Returns:
the top indicator

remove

public Node remove(int index)
Remove an element at a given position. The other attributes (width, height, depth) are not modified.

Specified by:
remove in interface NodeList
Overrides:
remove in class GenericNodeList
Parameters:
index - the position
Returns:
the element previously located at position index
See Also:
GenericNodeList.remove(int)

setTop

public void setTop(boolean top)
Setter for top.

Parameters:
top - the top to set
See Also:
isTop()

split

public VerticalListNode split(FixedDimen height,
                              java.util.logging.Logger logger,
                              java.util.logging.Logger traceLogger)
Split-off material from a vertical list of a desired height. The splitting is performed at a position with minimal penalty. The list is stretched to the desired height.

Parameters:
height - the target height
logger - the logger for normal logging output
traceLogger - the logger for tracing
Returns:
the split off material

spread

public long spread(FixedDimen height)
Spread the list vertically to a desired size by distributing the differences to the glues contained.

Parameters:
height - the target size
Returns:
the badness of the spread

toString

public void toString(java.lang.StringBuffer sb,
                     java.lang.String prefix,
                     int breadth,
                     int depth)
This method puts the printable representation into the string buffer. 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
Specified by:
toString in interface NodeList
Overrides:
toString in class GenericNodeList
Parameters:
sb - the output string buffer
prefix - the prefix string inserted at the beginning of each line
breadth - the breadth of the nodes to display
depth - the depth of the nodes to display
See Also:
Node.toString( java.lang.StringBuffer, java.lang.String, int, int)

toText

public void toText(java.lang.StringBuffer sb,
                   java.lang.String prefix)
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 GenericNodeList
Parameters:
sb - the output string buffer
prefix - the prefix string inserted at the beginning of each line
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
Overrides:
visit in class GenericNodeList
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)

vpack

public long vpack(FixedDimen targetHeight)
Adjust the variable nodes to achieve a given target height.

Parameters:
targetHeight - the target height
Returns:
the badness