de.dante.extex.typesetter.type
Interface NodeList

All Superinterfaces:
java.lang.Cloneable, Node, java.io.Serializable
All Known Implementing Classes:
GenericNodeList, VerticalListNode, VirtualCharNode

public interface NodeList
extends Node, java.lang.Cloneable

This interface describes the features of a linear collection of nodes.

The following picture describes the attributes and relations:

Note that the NodeList does not provide an automatic relation of the contents to the attributes. This means that adding a node does not update width, height, or depth.

Version:
$Revision: 1.9 $
Author:
Gerd Neugebauer
See Also:
Box

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.
 void clear()
          Remove all nodes from the list.
 NodeList copy()
          Clone the current object.
 Node get(int index)
          Getter for a node at a given position.
 Dimen getMove()
          Getter for the move value of the node list.
 Dimen getShift()
          Getter for the shift value of the node list.
 NodeIterator iterator()
          Get a new iterator for all nodes in the list.
 Node remove(int index)
          Remove an element at a given position.
 void setMove(FixedDimen d)
          Setter for the move value of the node list.
 void setShift(FixedDimen d)
          Setter for the shift value of the node list.
 int size()
          Getter for the number of elements of the list.
 void toString(java.lang.StringBuffer sb, java.lang.String prefix, int depth, int width)
          Print the node possibly truncated in breadth and depth.
 
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, toText, visit
 

Method Detail

add

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

Parameters:
index - the position of insertion
node - the node to add

add

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

Parameters:
node - the node to add

addSkip

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

Parameters:
glue - the glue to add

clear

public void clear()
Remove all nodes from the list. The list is empty afterwards. The dimensions are reset to zero unless target sizes are specified. In this case the target sizes are used.


copy

public NodeList copy()
Clone the current object.

Returns:
the copy

get

public Node 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

getMove

public Dimen getMove()
Getter for the move value of the node list. The move parameter describes how far from its original position the box is moved leftwards or rightwards. Positive values indicate a move rightwards.

Returns:
the move value

getShift

public Dimen getShift()
Getter for the shift value of the node list. The shift parameter describes how far from its original position the box is shifted up or down. Positive values indicate a shift downwards.

Returns:
the shift value

iterator

public NodeIterator iterator()
Get a new iterator for all nodes in the list. This method is just provided for completeness. Consider a conventional loop because of performance issues.

Returns:
the iterator for all nodes in the list

remove

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

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

setMove

public void setMove(FixedDimen d)
Setter for the move value of the node list. The move parameter describes how far from its original position the box is moved leftwards or rightwards. Positive values indicate a move rightwards.

Parameters:
d - the move value

setShift

public void setShift(FixedDimen d)
Setter for the shift value of the node list. The shift parameter describes how far from its original position the box is shifted up or down. Positive values indicate a shift downwards.

Parameters:
d - the amount to be shifted

size

public int size()
Getter for the number of elements of the list.

Returns:
the length of the list

toString

public void toString(java.lang.StringBuffer sb,
                     java.lang.String prefix,
                     int depth,
                     int width)
Print the node possibly truncated in breadth and depth.

Specified by:
toString in interface Node
Parameters:
sb - the target string buffer
prefix - the string inserted at the beginning of each line
depth - the depth limit for the pretty printing
width - the width limit for the pretty printing