com.teamkonzept.dom4jb.dom
Class FilteredNodeList

java.lang.Object
  |
  +--com.teamkonzept.dom4jb.dom.FilteredNodeList
All Implemented Interfaces:
NodeList

public class FilteredNodeList
extends Object
implements NodeList


Field Summary
protected  int initialCapacity
           
 
Constructor Summary
FilteredNodeList(NodeList baseList, Filter filter)
           
 
Method Summary
 void clear()
          Removes all of the elements from this list.
 void ensureCapacity(int minCapacity)
          Increases the capacity of this NodeList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
 Node get(int index)
          Returns the indexth item in the collection.
 int getLength()
          The number of nodes in the list.
 boolean isEmpty()
          Tests if this list has no elements.
 Node item(int index)
          Returns the indexth item in the collection.
 int size()
          Returns the number of elements in this list.
 void trimToSize()
          Trims the capacity of this NodeList instance to be the list's current size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initialCapacity

protected final int initialCapacity
See Also:
Constant Field Values
Constructor Detail

FilteredNodeList

public FilteredNodeList(NodeList baseList,
                        Filter filter)
Method Detail

trimToSize

public void trimToSize()
Trims the capacity of this NodeList instance to be the list's current size. An application can use this operation to minimize the storage of an NodeList instance.


ensureCapacity

public void ensureCapacity(int minCapacity)
Increases the capacity of this NodeList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.

Parameters:
minCapacity - the desired minimum capacity.

size

public int size()
Returns the number of elements in this list.

Returns:
the number of elements in this list.

getLength

public int getLength()
The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.

Specified by:
getLength in interface NodeList

isEmpty

public boolean isEmpty()
Tests if this list has no elements.

Returns:
true if this list has no elements; false otherwise.

get

public Node get(int index)
Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.

Parameters:
index - Index into the collection.
Returns:
The node at the indexth position in the NodeList, or null if that is not a valid index.

item

public Node item(int index)
Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.

Specified by:
item in interface NodeList
Parameters:
index - Index into the collection.
Returns:
The node at the indexth position in the NodeList, or null if that is not a valid index.

clear

public void clear()
Removes all of the elements from this list. The list will be empty after this call returns.



Copyright © 2001-2003 Team-Konzept GmbH & CO KG. All Rights Reserved.