org.apache.lenya.cms.site
Class NodeSet

java.lang.Object
  extended by org.apache.lenya.cms.site.NodeSet

public class NodeSet
extends java.lang.Object

A set containing nodes.


Constructor Summary
NodeSet(DocumentSet documents)
          Ctor.
NodeSet(org.apache.avalon.framework.service.ServiceManager manager)
          Ctor.
NodeSet(org.apache.avalon.framework.service.ServiceManager manager, SiteNode[] _nodes)
          Ctor.
 
Method Summary
 void add(SiteNode node)
          Adds a node to this set.
 void addAll(NodeSet set)
          Adds all nodes from a node set to this.
 NodeIterator ascending()
           
 void clear()
          Removes all nodes.
 boolean contains(SiteNode node)
           
 NodeIterator descending()
           
 Document[] getDocuments()
           
 SiteNode[] getNodes()
          Returns the documents contained in this set.
protected  SiteNode[] getNodesAscending()
           
protected  java.util.Set getSet()
          Returns the list object that stores the documents.
 boolean isEmpty()
          Checks if this set is empty.
 void remove(SiteNode resource)
          Removes a node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeSet

public NodeSet(org.apache.avalon.framework.service.ServiceManager manager)
Ctor.

Parameters:
manager - The service manager.

NodeSet

public NodeSet(org.apache.avalon.framework.service.ServiceManager manager,
               SiteNode[] _nodes)
Ctor.

Parameters:
manager - The service manager.
_nodes - The initial nodes.

NodeSet

public NodeSet(DocumentSet documents)
Ctor.

Parameters:
documents - The corresponding documents to derive nodes from.
Method Detail

contains

public boolean contains(SiteNode node)
Parameters:
node - A node.
Returns:
If the node is contained.

getSet

protected java.util.Set getSet()
Returns the list object that stores the documents.

Returns:
A list.

getNodes

public SiteNode[] getNodes()
Returns the documents contained in this set.

Returns:
An array of documents.

add

public void add(SiteNode node)
Adds a node to this set.

Parameters:
node - The node to add.

isEmpty

public boolean isEmpty()
Checks if this set is empty.

Returns:
A boolean value.

remove

public void remove(SiteNode resource)
Removes a node.

Parameters:
resource - The node.

clear

public void clear()
Removes all nodes.


ascending

public NodeIterator ascending()
Returns:
An iterator iterating in ascending order.

descending

public NodeIterator descending()
Returns:
An iterator iterating in descending order.

getNodesAscending

protected SiteNode[] getNodesAscending()

getDocuments

public Document[] getDocuments()
Returns:
All documents referenced by this node set.

addAll

public void addAll(NodeSet set)
Adds all nodes from a node set to this.

Parameters:
set - The set.


Copyright © 1999-2006 Apache Software Foundation. All Rights Reserved.