net.sourceforge.combean.graph.containers
Class NodeNumberingAsNodeSet

Package class diagram package NodeNumberingAsNodeSet
java.lang.Object
  extended by net.sourceforge.combean.graph.containers.NodeNumberingAsNodeSet
All Implemented Interfaces:
FixedNodeCollection, FixedNodeSet, NodeSet

public class NodeNumberingAsNodeSet
extends Object
implements NodeSet

A NodeSet which is implemented using a NodeNumbering. For every element in the set the node number is set to one and to zero otherwise.


Constructor Summary
NodeNumberingAsNodeSet(NodeNumbering nodeNum)
          constructor
 
Method Summary
 boolean add(Node v)
          Add a node to the set.
 void clear()
          Remove all elements from the set.
 boolean contains(Node v)
          Check if the set contains a certain node v.
 boolean isEmpty()
          Check if the collection contains any elements.
 NodeIterator iterator()
          Return an iterator through all nodes in the collection.
 boolean remove(Node v)
          Remove a node from the set.
 void setGraph(GlobalNodesGraphProp g)
          Set the graph which the node numbering refers to.
 int size()
          Return the number of elements in the set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeNumberingAsNodeSet

public NodeNumberingAsNodeSet(NodeNumbering nodeNum)
constructor

Method Detail

setGraph

public void setGraph(GlobalNodesGraphProp g)
Set the graph which the node numbering refers to. Calling this setter is only required if iteration through the set shall be done.

Parameters:
g - The g to set.

add

public final boolean add(Node v)
Description copied from interface: NodeSet
Add a node to the set. If the node is already contained in the set, nothing happens.

Specified by:
add in interface NodeSet
Parameters:
v - the node to be added.
Returns:
true if node has been added.

remove

public final boolean remove(Node v)
Description copied from interface: NodeSet
Remove a node from the set. If the node is not contained in the set, nothing happens.

Specified by:
remove in interface NodeSet
Parameters:
v - the node to be removed.
Returns:
true if node has been removed.

clear

public void clear()
Description copied from interface: NodeSet
Remove all elements from the set.

Specified by:
clear in interface NodeSet

size

public int size()
Description copied from interface: FixedNodeSet
Return the number of elements in the set.

Specified by:
size in interface FixedNodeSet
Returns:
number of elements.

contains

public boolean contains(Node v)
Description copied from interface: FixedNodeSet
Check if the set contains a certain node v.

Specified by:
contains in interface FixedNodeSet
Returns:
true if v is contained in the set.

iterator

public NodeIterator iterator()
Description copied from interface: FixedNodeCollection
Return an iterator through all nodes in the collection.

Specified by:
iterator in interface FixedNodeCollection
Returns:
iterator

isEmpty

public boolean isEmpty()
Description copied from interface: FixedNodeCollection
Check if the collection contains any elements.

Specified by:
isEmpty in interface FixedNodeCollection
Returns:
true if empty.