ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.beans.petrinet
Class AblePetriPlace

java.lang.Object
  extended bycom.ibm.able.AbleObject
      extended bycom.ibm.able.beans.petrinet.AblePetriNode
          extended bycom.ibm.able.beans.petrinet.AblePetriPlace
All Implemented Interfaces:
AbleBean, AbleDataBufferManager, AbleEventListener, AbleEventListenerManager, AbleEventQueueManager, AbleEventQueueProcessor, AblePropertyChangeManager, AbleSerializable, java.io.Serializable

public class AblePetriPlace
extends AblePetriNode
implements java.io.Serializable

This class represents a Place (state) in a High-Level Petri net

See Also:
Serialized Form

Field Summary
protected  java.util.Vector myColorSets
           
protected  java.util.Vector myCurrentMarking
           
protected  java.lang.String myExpressionText
           
protected  AbleExpression myInitializationExpr
           
protected  AblePetriNet myPetriNet
           
protected  java.util.Vector myTokens
           
 
Fields inherited from class com.ibm.able.beans.petrinet.AblePetriNode
myInputArcs, myOutputArcs
 
Fields inherited from class com.ibm.able.AbleObject
changed, chgSupport, comment, dataFlowEnabled, defaultName, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, properties, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace
 
Constructor Summary
AblePetriPlace()
          Create an instance of a Place
AblePetriPlace(java.lang.String theName)
          Create an instance of a Place with specified name
 
Method Summary
 void addToken(java.lang.Object theToken)
           
 void addTokens(java.util.Vector theTokens)
           
 java.util.Vector getColorSets()
           
 java.util.Vector getCurrentMarking()
           
 java.lang.String getExpressionText()
           
 AbleExpression getInitializationExpression()
           
 int getNumTokens()
           
 java.util.Vector getTokens()
           
 void init()
          Initialize and configure the bean.
 java.util.Vector removeNTokens(int n)
          Remove N tokens from the place and return them
 void removeToken(java.lang.Object theToken)
           
 void setColorSets(java.util.Vector theColorSets)
           
 void setCurrentMarking(java.util.Vector theMarking)
           
 void setExpressionText(java.lang.String text)
           
 void setInitializationExpression(AbleExpression theExpression)
           
 void setTokens(java.util.Vector theTokens)
           
 java.lang.String toString()
           
 
Methods inherited from class com.ibm.able.beans.petrinet.AblePetriNode
addDestBufferConnection, addInputArc, addOutputArc, addSourceBufferConnection, getDestBufferConnections, getInputArcs, getName, getOutputArcs, getSourceBufferConnections, removeDestBufferConnection, removeInputArc, removeOutputArc, removeSourceBufferConnection, setInputArcs, setOutputArcs
 
Methods inherited from class com.ibm.able.AbleObject
addAbleEventListener, addPropertyChangeListener, addPropertyConnection, addStateChangeListener, dataChanged, firePropertyChange, flushAbleEventQueue, getAbleEventListeners, getAbleEventProcessingEnabled, getAbleEventQueueSize, getComment, getFileName, getInputBuffer, getInputBuffer, getInputBufferAsString, getInputBufferAsStringArray, getInputBufferContents, getLogger, getOutputBuffer, getOutputBuffer, getOutputBufferAsString, getOutputBufferAsStringArray, getOutputBufferContents, getParent, getProperties, getProperty, getPropertyChangeListeners, getPropertyConnectionManager, getSleepTime, getState, getTraceLogger, handleAbleEvent, hasInputBuffer, hasOutputBuffer, init, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, process, process, processAbleEvent, processBufferConnections, processNoEventProcessingEnabledSituation, processTimerEvent, quitAll, quitEnabledEventProcessing, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllConnections, removeAllPropertyConnections, removeProperty, removePropertyChangeListener, removePropertyConnection, removeStateChangeListener, reset, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeAll, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setDataFlowEnabled, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, setProperties, setProperty, setSleepTime, setState, setTimerEventProcessingEnabled, setTraceLogger, sourceConnectionsOK, startEnabledEventProcessing, suspendAll, suspendEnabledEventProcessing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myColorSets

protected java.util.Vector myColorSets

myInitializationExpr

protected AbleExpression myInitializationExpr

myExpressionText

protected java.lang.String myExpressionText

myCurrentMarking

protected java.util.Vector myCurrentMarking

myTokens

protected java.util.Vector myTokens

myPetriNet

protected AblePetriNet myPetriNet
Constructor Detail

AblePetriPlace

public AblePetriPlace()
               throws AbleException
Create an instance of a Place


AblePetriPlace

public AblePetriPlace(java.lang.String theName)
               throws AbleException
Create an instance of a Place with specified name

Method Detail

setCurrentMarking

public void setCurrentMarking(java.util.Vector theMarking)

getCurrentMarking

public java.util.Vector getCurrentMarking()

setInitializationExpression

public void setInitializationExpression(AbleExpression theExpression)

getInitializationExpression

public AbleExpression getInitializationExpression()

setColorSets

public void setColorSets(java.util.Vector theColorSets)

getColorSets

public java.util.Vector getColorSets()

setTokens

public void setTokens(java.util.Vector theTokens)

getTokens

public java.util.Vector getTokens()

getNumTokens

public int getNumTokens()

addToken

public void addToken(java.lang.Object theToken)

addTokens

public void addTokens(java.util.Vector theTokens)

removeToken

public void removeToken(java.lang.Object theToken)

removeNTokens

public java.util.Vector removeNTokens(int n)
Remove N tokens from the place and return them

Parameters:
n -
Returns:
the N tokens removed from the Place

init

public void init()
          throws AbleException
Description copied from class: AbleObject
Initialize and configure the bean. The bean's state changes to AbleState.Initiated or AbleState.Waiting. If either the AbleEventProcessing or TimerEventProcessing flags are enabled, this method calls AbleObject.startEnabledEventProcessing() to start a new thread for asynchronous or timer event processing.

An AbleProperty.ProcessingState PropertyChangeEvent is fired.

Beans overriding this method should call super.init() after any customization and before returning so that the thread is started if needed and the PropertyChangeEvent is fired.

An application using asynchronous or timer event processing should sleep until the event queue is functional by imbedding logic like this:

    anAbleObject.init();
    while (!AbleState.isReady(anAbleObject.getState())) {
        try {
            Thread.sleep(100l);
        } catch (InterruptedException e1) {
        }
    }
 

Specified by:
init in interface AbleBean
Overrides:
init in class AbleObject
Throws:
AbleException - If an error occurs.
See Also:
AbleObject.startEnabledEventProcessing()

getExpressionText

public java.lang.String getExpressionText()
Returns:

setExpressionText

public void setExpressionText(java.lang.String text)

toString

public java.lang.String toString()

ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005