org.extex.typesetter.type
Interface NodeList

All Superinterfaces:
java.lang.Cloneable, java.lang.Iterable<Node>, Node, java.io.Serializable
All Known Subinterfaces:
OrientedNodeList
All Known Implementing Classes:
GenericNodeList, HorizontalListNode, VerticalListNode, VirtualCharNode

public interface NodeList
extends Node, java.lang.Iterable<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: 4739 $
Author:
Gerd Neugebauer

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.
 boolean isEmpty()
          Test whether the node list is empty.
 java.util.Iterator<Node> 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.
 java.lang.String toText()
          Provides a string representation of the current instance.
 
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, toText, visit
 

Method Detail

add

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

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

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

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

NodeList copy()
Clone the current object.

Returns:
the copy

get

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

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

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

isEmpty

boolean isEmpty()
Test whether the node list is empty.

Returns:
true, if the NodeList is empty, otherwise false.

iterator

java.util.Iterator<Node> 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.

Specified by:
iterator in interface java.lang.Iterable<Node>
Returns:
the iterator for all nodes in the list

remove

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

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

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

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

Returns:
the length of the list

toString

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

toText

java.lang.String toText()
Provides a string representation of the current instance.

Returns:
the String representation of the object
See Also:
"TeX – The Program [182]"