org.mmbase.bridge.util
Class CollectionNodeList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byorg.mmbase.bridge.util.AbstractBridgeList
              extended byorg.mmbase.bridge.util.CollectionNodeList
All Implemented Interfaces:
BridgeList, Collection, List, NodeList
Direct Known Subclasses:
CollectionRelationList

public class CollectionNodeList
extends AbstractBridgeList
implements NodeList

A (fixed-size) list of nodes, based on a Collection of Nodes. If the collection is a List it will mirror its' changes. Otherwise, no, because the complete collection is inserted in its own one.

Since:
MMBase-1.8
Version:
$Id: CollectionNodeList.java,v 1.3 2005/12/30 10:38:10 michiel Exp $
Author:
Michiel Meeuwissen

Nested Class Summary
protected  class CollectionNodeList.BasicNodeIterator
           
 
Nested classes inherited from class org.mmbase.bridge.util.AbstractBridgeList
AbstractBridgeList.BasicIterator
 
Field Summary
protected  Cloud cloud
           
protected  NodeManager nodeManager
           
protected  List wrappedCollection
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Fields inherited from interface org.mmbase.bridge.NodeList
NODESTEP_PROPERTY, QUERY_PROPERTY
 
Constructor Summary
CollectionNodeList(Collection c)
           
CollectionNodeList(Collection c, Cloud cloud)
           
CollectionNodeList(Collection c, NodeManager nodeManager)
           
 
Method Summary
protected  Object convert(Object o, int index)
           
 Object get(int index)
           
 Node getNode(int index)
          Returns the Node at the indicated postion in the list
 NodeIterator nodeIterator()
          Returns an type-specific iterator for this list.
 Object set(int index, Object o)
           
 int size()
           
 NodeList subNodeList(int fromIndex, int toIndex)
          Returns a sublist of this list.
 
Methods inherited from class org.mmbase.bridge.util.AbstractBridgeList
getProperty, setProperty, sort, sort
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.bridge.BridgeList
getProperty, setProperty, sort, sort
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, subList, toArray, toArray
 

Field Detail

cloud

protected Cloud cloud

nodeManager

protected NodeManager nodeManager

wrappedCollection

protected final List wrappedCollection
Constructor Detail

CollectionNodeList

public CollectionNodeList(Collection c,
                          NodeManager nodeManager)

CollectionNodeList

public CollectionNodeList(Collection c,
                          Cloud cloud)

CollectionNodeList

public CollectionNodeList(Collection c)
Method Detail

size

public int size()
Specified by:
size in interface List

get

public Object get(int index)
Specified by:
get in interface List

set

public Object set(int index,
                  Object o)
Specified by:
set in interface List

convert

protected Object convert(Object o,
                         int index)

getNode

public Node getNode(int index)
Description copied from interface: NodeList
Returns the Node at the indicated postion in the list

Specified by:
getNode in interface NodeList
Parameters:
index - the position of the Node to retrieve
Returns:
Node at the indicated postion

subNodeList

public NodeList subNodeList(int fromIndex,
                            int toIndex)
Description copied from interface: NodeList
Returns a sublist of this list.

Specified by:
subNodeList in interface NodeList
Parameters:
fromIndex - the position in the current list where the sublist starts (inclusive)
toIndex - the position in the current list where the sublist ends (exclusive)
Returns:
sublist of this list

nodeIterator

public NodeIterator nodeIterator()
Description copied from interface: NodeList
Returns an type-specific iterator for this list.

Specified by:
nodeIterator in interface NodeList
Returns:
Node iterator


MMBase build 1.8.1.20060716