org.yawlfoundation.yawl.elements
Class YCondition

java.lang.Object
  extended by org.yawlfoundation.yawl.elements.YNetElement
      extended by org.yawlfoundation.yawl.elements.YExternalNetElement
          extended by org.yawlfoundation.yawl.elements.YCondition
All Implemented Interfaces:
Cloneable, Comparable, YConditionInterface, YVerifiable
Direct Known Subclasses:
YInputCondition, YOutputCondition

public class YCondition
extends YExternalNetElement
implements YConditionInterface

An external condition is equivalent to a condition in the YAWL paper.

Author:
Lachlan Aldred

Field Summary
protected  YIdentifierBag _bag
           
 
Fields inherited from class org.yawlfoundation.yawl.elements.YExternalNetElement
_documentation, _name, _net
 
Constructor Summary
YCondition(String id, String label, YNet container)
           
YCondition(String id, YNet container)
           
 
Method Summary
 void add(YPersistenceManager pmgr, YIdentifier identifier)
          Add an identifier to the condition.
 Object clone()
           
 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 identifiers in a condition that match the specified identifier.
 List<YIdentifier> getIdentifiers()
          Get all the identifiers in a condition.
 boolean isAnonymous()
           
 boolean isImplicit()
           
 void remove(YPersistenceManager pmgr, YIdentifier identifier, int amount)
          Remove a specified number of identifiers equal to the specified identifier from the condition.
 void removeAll(YPersistenceManager pmgr)
          Remove all the identifiers in the condition.
 void removeAll(YPersistenceManager pmgr, YIdentifier identifier)
          Remove all the identifiers that match the specified identifier.
 YIdentifier removeOne(YPersistenceManager pmgr)
          Remove one identifier from the condition.
 void removeOne(YPersistenceManager pmgr, YIdentifier identifier)
          Remove one identifier equal to the specified identifier from the condition.
 void setImplicit(boolean isImplicit)
           
 String toXML()
           
 List<YVerificationMessage> verify()
          Internally verify the object against YAWL language semantics and report any errors and/or warnings.
 
Methods inherited from class org.yawlfoundation.yawl.elements.YExternalNetElement
addPostset, addPreset, addToCancelledBySet, addToYawlMappings, addToYawlMappings, getCancelledBySet, getDocumentation, getDocumentationPreParsed, getName, getNet, getPostsetElement, getPostsetElements, getPostsetFlow, getPostsetFlows, getPresetElement, getPresetElements, getPresetFlow, getPresetFlows, getProperID, getYawlMappings, removeFromCancelledBySet, removePostsetFlow, removePresetFlow, setDocumentation, setName, verifyPostsetFlows, verifyPresetFlows
 
Methods inherited from class org.yawlfoundation.yawl.elements.YNetElement
compareTo, getID, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_bag

protected YIdentifierBag _bag
Constructor Detail

YCondition

public YCondition(String id,
                  String label,
                  YNet container)

YCondition

public YCondition(String id,
                  YNet container)
Method Detail

setImplicit

public void setImplicit(boolean isImplicit)

isImplicit

public boolean isImplicit()

verify

public List<YVerificationMessage> verify()
Description copied from interface: YVerifiable
Internally verify the object against YAWL language semantics and report any errors and/or warnings.

Specified by:
verify in interface YVerifiable
Overrides:
verify in class YExternalNetElement
Returns:
a List of YVerificationMessage objects
See Also:
YVerificationMessage

isAnonymous

public boolean isAnonymous()

add

public void add(YPersistenceManager pmgr,
                YIdentifier identifier)
         throws YPersistenceException
Description copied from interface: YConditionInterface
Add an identifier to the condition.

Specified by:
add in interface YConditionInterface
Parameters:
pmgr - an instantiated persistence manager object.
identifier - the identifier to add.
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 - the identifier in question.
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)
Description copied from interface: YConditionInterface
Get the number of identifiers in a condition that match the specified identifier.

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

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.

removeOne

public YIdentifier removeOne(YPersistenceManager pmgr)
                      throws YPersistenceException
Description copied from interface: YConditionInterface
Remove one identifier from the condition. If there are none to remove then make no change to the condition's state.

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
Description copied from interface: YConditionInterface
Remove one identifier equal to the specified identifier from the condition. If there are none to remove, or none matching the specified identifier, then make no change to the condition's state.

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

remove

public void remove(YPersistenceManager pmgr,
                   YIdentifier identifier,
                   int amount)
            throws YPersistenceException
Description copied from interface: YConditionInterface
Remove a specified number of identifiers equal to the specified identifier from the condition.

Specified by:
remove in interface YConditionInterface
Parameters:
pmgr - an instantiated persistence manager object.
identifier - an identifier matching the ones to be removed.
amount - the number of matching identifiers to remove.
Throws:
YPersistenceException - if there's a problem persisting the change.

removeAll

public void removeAll(YPersistenceManager pmgr,
                      YIdentifier identifier)
               throws YPersistenceException
Description copied from interface: YConditionInterface
Remove all the identifiers that match the specified identifier.

Specified by:
removeAll in interface YConditionInterface
Parameters:
pmgr - an instantiated persistence manager object.
identifier - an identifier matching the ones to be removed.
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.

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class YExternalNetElement
Throws:
CloneNotSupportedException

toXML

public String toXML()
Overrides:
toXML in class YExternalNetElement


Copyright © 2004-2012 The YAWL Foundation.