net.sourceforge.combean.graph.containers
Class SetAsNodeSet

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

public class SetAsNodeSet
extends Object
implements NodeSet

A wrapper which turns a java.lang.util.Set into a NodeSet.


Constructor Summary
SetAsNodeSet(Set<Node> implSet)
          Construct NodeSet wrapper for java.lang.util.Set
 
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.
 Set getImplementation()
           
 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.
 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

SetAsNodeSet

public SetAsNodeSet(Set<Node> implSet)
Construct NodeSet wrapper for java.lang.util.Set

Parameters:
implSet - the Set to be wrapped
Method Detail

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.
See Also:
NodeSet.add(net.sourceforge.combean.interfaces.graph.Node)

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.
See Also:
NodeSet.remove(net.sourceforge.combean.interfaces.graph.Node)

clear

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

Specified by:
clear in interface NodeSet
See Also:
NodeSet.clear()

size

public final 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.
See Also:
FixedNodeSet.size()

contains

public final 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.
See Also:
FixedNodeSet.contains(net.sourceforge.combean.interfaces.graph.Node)

iterator

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

Specified by:
iterator in interface FixedNodeCollection
Returns:
iterator
See Also:
FixedNodeCollection.iterator()

isEmpty

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

Specified by:
isEmpty in interface FixedNodeCollection
Returns:
true if empty.
See Also:
FixedNodeCollection.isEmpty()

getImplementation

public final Set getImplementation()
Returns:
the java.util.Set instance which is used for implementing the NodeSet