eaLib API Docs
Last Modified : January 7 2002

mss.ea.al
Class AbstractConduit

java.lang.Object
  |
  +--mss.ea.al.FlowElement
        |
        +--mss.ea.al.AbstractConduit
All Implemented Interfaces:
MessageRecipient, java.lang.Runnable
Direct Known Subclasses:
StreamConduit

public abstract class AbstractConduit
extends FlowElement

Abstract base for a conduit. A conduit is is a flow element which has an arbitrary number of predecessors and successors.

Since:
0.2
Version:
$Revision: 1.4 $ $Date: 2001/11/27 14:48:07 $
Author:
Andreas Rummler

Field Summary
protected  java.util.ArrayList predecessorList
          Predecessor list of this conduit.
protected  java.util.ArrayList successorList
          Successor list of this conduit.
 
Fields inherited from class mss.ea.al.FlowElement
broker, messageChannel, name, receivedMessage, sync
 
Constructor Summary
AbstractConduit(MessageBroker broker, java.lang.String name)
          Constructor with message broker.
AbstractConduit(java.lang.String name)
          Constructor.
 
Method Summary
 FlowElement getPredecessor(int index)
          Gets a predecessor of this conduit.
 int getPredecessorNumber()
          Gets the number of current predecessors.
 FlowElement getSuccessor(int index)
          Gets a successor of this conduit.
 int getSuccessorNumber()
          Gets the number of current successors.
 boolean hasPredecessor()
          Checks if this conduit has at least one predecessor.
 boolean hasSuccessor()
          Checks if this conduit has at least one successor.
 void setPredecessor(FlowElement predecessor, int index)
          Sets a new predecessor.
 void setSuccessor(FlowElement successor, int index)
          Sets a new successor.
 
Methods inherited from class mss.ea.al.FlowElement
acquireChannel, react, register, run, setBroker, setChannel, setSync, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

predecessorList

protected java.util.ArrayList predecessorList
Predecessor list of this conduit.

successorList

protected java.util.ArrayList successorList
Successor list of this conduit.
Constructor Detail

AbstractConduit

public AbstractConduit(java.lang.String name)
Constructor.
Parameters:
name - name of this conduit

AbstractConduit

public AbstractConduit(MessageBroker broker,
                       java.lang.String name)
Constructor with message broker.
Parameters:
broker - message broker
name - name of this conduit
Method Detail

hasPredecessor

public boolean hasPredecessor()
Checks if this conduit has at least one predecessor.
Overrides:
hasPredecessor in class FlowElement
Returns:
result of the check

hasSuccessor

public boolean hasSuccessor()
Checks if this conduit has at least one successor.
Overrides:
hasSuccessor in class FlowElement
Returns:
result of the check

getPredecessor

public FlowElement getPredecessor(int index)
Gets a predecessor of this conduit. This method returns null if an invalid index is given or if the given slot does not contain a flow element.
Overrides:
getPredecessor in class FlowElement
Parameters:
index - index of the predecessor
Returns:
predecessor element or null

getSuccessor

public FlowElement getSuccessor(int index)
Gets a successor of this conduit. This method returns null if an invalid index is given or if the given slot does not contain a flow element.
Overrides:
getSuccessor in class FlowElement
Parameters:
index - index of the successor
Returns:
successor element or null

setPredecessor

public void setPredecessor(FlowElement predecessor,
                           int index)
Sets a new predecessor. In case of an index < 0 this method does nothing. In case that the given index is bigger than the current length of the successor list, the list is resized to insert the given element at the given index. The positions between are filled with null elements.
Overrides:
setPredecessor in class FlowElement
Parameters:
successor - new successor
index - index of the successor

setSuccessor

public void setSuccessor(FlowElement successor,
                         int index)
Sets a new successor. In case of an index < 0 this method does nothing. In case that the given index is bigger than the current length of the successor list, the list is resized to insert the given element at the given index. The positions between are filled with null elements.
Overrides:
setSuccessor in class FlowElement
Parameters:
successor - new successor
index - index of the successor

getPredecessorNumber

public int getPredecessorNumber()
Gets the number of current predecessors.
Overrides:
getPredecessorNumber in class FlowElement
Returns:
number of predecessors

getSuccessorNumber

public int getSuccessorNumber()
Gets the number of current successors.
Overrides:
getSuccessorNumber in class FlowElement
Returns:
number of successors

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS