Search this API

y.base
Class NodeList

java.lang.Object
  extended by y.base.YList
      extended by y.base.NodeList
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.List

public class NodeList
extends YList

Specialized list implementation for instances of type Node.

 

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

Constructor Detail

NodeList

public NodeList()
Creates an empty node list.


NodeList

public NodeList(NodeCursor c)
Creates a list that is initialized with the nodes provided by the given NodeCursor object.


NodeList

public NodeList(NodeCursor nc,
                DataProvider predicate)
Creates a list that is initialized with those nodes from the given NodeCursor object for which the given data provider returns true upon calling its getBool method.

Parameters:
nc - A node cursor providing nodes that should be added to this list.
predicate - A data provider that acts as a inclusion predicate for each node accessible by the given node cursor.

NodeList

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


NodeList

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


NodeList

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


NodeList

public NodeList(NodeList list)
Creates a list that is initialized with the entries of the given list.

Parameters:
list - the values are added to the new list
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, or null when the list is empty.

Returns:
The first node in the list.

lastNode

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

Returns:
The last node in the list.

popNode

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

Returns:
The first node from the list.

toNodeArray

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


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