org.drools.ruleflow.core.impl
Class ConnectionImpl

java.lang.Object
  extended by org.drools.ruleflow.core.impl.ConnectionImpl
All Implemented Interfaces:
java.io.Serializable, Connection

public class ConnectionImpl
extends java.lang.Object
implements Connection, java.io.Serializable

Default implementation of a connection.

Author:
Kris Verlaenen
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.drools.ruleflow.core.Connection
TYPE_ABORT, TYPE_NORMAL
 
Constructor Summary
ConnectionImpl(Node from, Node to, int type)
          Creates a new connection, given a from node, a to node and a type.
 
Method Summary
 Node getFrom()
          Returns the from node of the connection.
 Node getTo()
          Returns the to node of the connection
 int getType()
          Returns the connection type
 void terminate()
          Destroys the connection.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConnectionImpl

public ConnectionImpl(Node from,
                      Node to,
                      int type)
Creates a new connection, given a from node, a to node and a type.

Parameters:
from - The from node
to - The to node
type - The connection type
Method Detail

terminate

public void terminate()
Description copied from interface: Connection
Destroys the connection. This method also removes the connection on the to and from nodes. Onces a connection is destroyed, all methods throw an IllegalStateException.

Specified by:
terminate in interface Connection

getFrom

public Node getFrom()
Description copied from interface: Connection
Returns the from node of the connection.

Specified by:
getFrom in interface Connection
Returns:
the from node of the connection.

getTo

public Node getTo()
Description copied from interface: Connection
Returns the to node of the connection

Specified by:
getTo in interface Connection
Returns:
the to node of the connection

getType

public int getType()
Description copied from interface: Connection
Returns the connection type

Specified by:
getType in interface Connection
Returns:
the connection type

toString

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