org.yawlfoundation.yawl.elements.state
Class YInternalCondition

java.lang.Object
  extended by org.yawlfoundation.yawl.elements.YNetElement
      extended by org.yawlfoundation.yawl.elements.state.YInternalCondition
All Implemented Interfaces:
Cloneable, Comparable, YConditionInterface

public class YInternalCondition
extends YNetElement
implements YConditionInterface

Author:
Lachlan Aldred Date: 24/04/2003 Time: 10:17:37

Field Summary
static String _mi_active
           
static String _mi_complete
           
static String _mi_entered
           
static String _mi_executing
           
 YTask _myTask
           
 
Constructor Summary
YInternalCondition(String id, YTask myTask)
           
 
Method Summary
 void add(YPersistenceManager pmgr, YIdentifier identifier)
          Adds an identifier to the collection.
 boolean contains(YIdentifier identifier)
          Check whether a condition contains the specified identifier.
 boolean containsIdentifier()
          Check whether a condition has at least one identifier.
 int getAmount(YIdentifier identifier)
          Get the number of identifier matching the the one passed in.
 List<YIdentifier> getIdentifiers()
          Get all the identifiers in a condition.
 void remove(YPersistenceManager pmgr, YIdentifier identifier, int amount)
          Remove from this amount YIdentifiers equal to identifier.
 void removeAll(YPersistenceManager pmgr)
          Remove all the identifiers in the condition.
 void removeAll(YPersistenceManager pmgr, YIdentifier identifier)
          Removes all the YIdentifiers equal to identifier.
 YIdentifier removeOne(YPersistenceManager pmgr)
          Removes one YIdentifier from this condition.
 void removeOne(YPersistenceManager pmgr, YIdentifier identifier)
          Removes one YIdentifier equal to identifier from the condition.
 String toString()
           
 String toXML()
           
 XNode toXNode()
           
 
Methods inherited from class org.yawlfoundation.yawl.elements.YNetElement
clone, compareTo, getID
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_myTask

public YTask _myTask

_mi_active

public static String _mi_active

_mi_entered

public static String _mi_entered

_mi_executing

public static String _mi_executing

_mi_complete

public static String _mi_complete
Constructor Detail

YInternalCondition

public YInternalCondition(String id,
                          YTask myTask)
Method Detail

add

public void add(YPersistenceManager pmgr,
                YIdentifier identifier)
         throws YPersistenceException
Adds an identifier to the collection.

Specified by:
add in interface YConditionInterface
Parameters:
identifier -
pmgr - an instantiated persistence manager object.
Throws:
YPersistenceException - if there's a problem persisting the change.

contains

public boolean contains(YIdentifier identifier)
Description copied from interface: YConditionInterface
Check whether a condition contains the specified identifier.

Specified by:
contains in interface YConditionInterface
Parameters:
identifier -
Returns:
true iff this contains identifier.

containsIdentifier

public boolean containsIdentifier()
Description copied from interface: YConditionInterface
Check whether a condition has at least one identifier.

Specified by:
containsIdentifier in interface YConditionInterface
Returns:
true iff this contains one or more identifier.

getAmount

public int getAmount(YIdentifier identifier)
Get the number of identifier matching the the one passed in.

Specified by:
getAmount in interface YConditionInterface
Parameters:
identifier -
Returns:
the number of equal identifiers in this.

getIdentifiers

public List<YIdentifier> getIdentifiers()
Description copied from interface: YConditionInterface
Get all the identifiers in a condition.

Specified by:
getIdentifiers in interface YConditionInterface
Returns:
a List of the identifiers in the condition numbering 1 or more.

removeOne

public YIdentifier removeOne(YPersistenceManager pmgr)
                      throws YPersistenceException
Removes one YIdentifier from this condition. If there are none inside then make no change to the state of this.

Specified by:
removeOne in interface YConditionInterface
Parameters:
pmgr - an instantiated persistence manager object.
Returns:
the identifier that has been removed.
Throws:
YPersistenceException - if there's a problem persisting the change.

removeOne

public void removeOne(YPersistenceManager pmgr,
                      YIdentifier identifier)
               throws YPersistenceException
Removes one YIdentifier equal to identifier from the condition. If there are none inside then make no change to the state of this.

Specified by:
removeOne in interface YConditionInterface
Parameters:
identifier -
pmgr - an instantiated persistence manager object.
Throws:
YPersistenceException - if there's a problem persisting the change.

remove

public void remove(YPersistenceManager pmgr,
                   YIdentifier identifier,
                   int amount)
            throws YStateException,
                   YPersistenceException
Remove from this amount YIdentifiers equal to identifier.

Specified by:
remove in interface YConditionInterface
Parameters:
identifier -
amount - the amount to remove.
pmgr - an instantiated persistence manager object.
Throws:
YStateException - iff amount is greater than the number of YIdentifiers held inside this, and further more no change will be made to the state of this.
YPersistenceException - if there's a problem persisting the change.

removeAll

public void removeAll(YPersistenceManager pmgr,
                      YIdentifier identifier)
               throws YPersistenceException
Removes all the YIdentifiers equal to identifier.

Specified by:
removeAll in interface YConditionInterface
Parameters:
identifier -
pmgr - an instantiated persistence manager object.
Throws:
YPersistenceException - if there's a problem persisting the change.

removeAll

public void removeAll(YPersistenceManager pmgr)
               throws YPersistenceException
Description copied from interface: YConditionInterface
Remove all the identifiers in the condition.

Specified by:
removeAll in interface YConditionInterface
Parameters:
pmgr - an instantiated persistence manager object.
Throws:
YPersistenceException - if there's a problem persisting the change.

toString

public String toString()
Overrides:
toString in class YNetElement

toXML

public String toXML()

toXNode

public XNode toXNode()


Copyright © 2004-2012 The YAWL Foundation.