org.jwarp.util
Class Circuit

java.lang.Object
  |
  +--org.jwarp.util.Circuit

public class Circuit
extends java.lang.Object

The circuit is a set of objects related to each other. You can add objects and then connect them to several instances of other objects. Removing an object also tries to remove all the connection to/from other objects.

Author:
Anatole Tresch

Inner Class Summary
 class Circuit.CircuitException
           
protected  class Circuit.Node
          private Node class
 
Constructor Summary
Circuit()
          Constructor.
 
Method Summary
 void addNode(java.lang.String name)
          Add a node.
 java.lang.String getAncestor()
          Return the ancestor.
 java.util.Vector getAncestors()
          Return the ancestors.
 boolean isEmpty()
           
 void link(java.lang.String parent, java.lang.String child)
          Link a parent to a child.
 void removeNode(java.lang.String name)
          Remove a node
 java.lang.String toString()
           
 void unlink(java.lang.String parent, java.lang.String child)
          Link a parent to a child.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Circuit

public Circuit()
Constructor.
Method Detail

addNode

public void addNode(java.lang.String name)
Add a node.
Parameters:
name - The new node

removeNode

public void removeNode(java.lang.String name)
Remove a node
Parameters:
The - node

link

public void link(java.lang.String parent,
                 java.lang.String child)
          throws Circuit.CircuitException
Link a parent to a child.
Parameters:
parent - The parent
child - The child
Throws:
Circuit.CircuitException -  

unlink

public void unlink(java.lang.String parent,
                   java.lang.String child)
            throws Circuit.CircuitException
Link a parent to a child.
Parameters:
parent - The parent
child - The child
Throws:
Circuit.CircuitException -  

getAncestors

public java.util.Vector getAncestors()
Return the ancestors.
Returns:
The ancestors

getAncestor

public java.lang.String getAncestor()
Return the ancestor.
Returns:
The ancestor

isEmpty

public boolean isEmpty()
Returns:
true if it is empty

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

©   O R C A   S y s t e m s