y.base
Class NodeList

java.lang.Object
  |
  +--y.base.YList
        |
        +--y.base.NodeList
All Implemented Interfaces:
Collection

public class NodeList
extends YList

This is a special list implementation for instances of type Node.


Nested Class Summary
 
Nested classes inherited from class y.base.YList
YList.ListCursorImpl
 
Constructor Summary
NodeList()
          Creates an empty List.
NodeList(Iterator it)
          Creates a list that is initialized with the elements provided by the Iterator it.
NodeList(Node v)
          Creates a list that is initialized with a single element provided
NodeList(Node[] a)
          Creates a list that is initialized with the elements provided by the given array of Nodes
NodeList(NodeCursor c)
          Creates a list containing the nodes accessible via the given node cursor.
NodeList(NodeCursor nc, DataProvider predicate)
          Creates a list containing the nodes accessible via the given node cursor for which the given data provider returns true upon calling its getBool method.
 
Method Summary
 Node firstNode()
          Returns the first node in this list, null when the list is empty.
 Node lastNode()
          Returns the last node in this list, null when the list is empty.
 NodeCursor nodes()
          Returns a node cursor for this node list.
 Node popNode()
          Removes the first node in this list and returns it.
 Node[] toNodeArray()
          Returns a node array containing all elements of this list in the canonic order.
 
Methods inherited from class y.base.YList
add, addAll, addAll, addFirst, addFirstCell, addLast, addLastCell, clear, contains, containsAll, cursor, cyclicPred, cyclicSucc, elementAt, findCell, first, firstCell, getInfo, indexOf, insertAfter, insertBefore, insertCellAfter, insertCellBefore, isEmpty, iterator, last, lastCell, peek, pop, popLast, predCell, push, remove, removeAll, removeAt, removeCell, retainAll, reverse, setInfo, size, sort, sort, splice, succCell, toArray, toArray, toString, toVector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

NodeList

public NodeList()
Creates an empty List.


NodeList

public NodeList(NodeCursor c)
Creates a list containing the nodes accessible via the given node cursor.

Parameters:
c - A node cursor providing nodes that are initially entered into this list.

NodeList

public NodeList(NodeCursor nc,
                DataProvider predicate)
Creates a list containing the nodes accessible via the given node cursor for which the given data provider returns true upon calling its getBool method.

Parameters:
nc - a node cursor providing nodes that are initially entered into this list.
predicate - a dataprovider that acts as a inclusion predicate for each node accessible from the node cursor

NodeList

public NodeList(Iterator it)
Creates a list that is initialized with the elements provided by the Iterator it.


NodeList

public NodeList(Node[] a)
Creates a list that is initialized with the elements provided by the given array of Nodes


NodeList

public NodeList(Node v)
Creates a list that is initialized with a single element provided

Method Detail

nodes

public NodeCursor nodes()
Returns a node cursor for this node list.

Returns:
A node cursor granting access to the nodes within this list.

firstNode

public Node firstNode()
Returns the first node in this list, null when the list is empty.

Returns:
the first node in the list.

lastNode

public Node lastNode()
Returns the last node in this list, null when the list is empty.

Returns:
the last node in the list.

popNode

public Node popNode()
Removes the first node in this list and returns it.

Returns:
the first node in the list.

toNodeArray

public Node[] toNodeArray()
Returns a node array containing all elements of this list in the canonic order.


© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003