org.yawlfoundation.yawl.elements
Interface YConditionInterface

All Known Implementing Classes:
YCondition, YInputCondition, YInternalCondition, YOutputCondition

public interface YConditionInterface

This interface expresses the ability to hold tokens (Identifiers), nothing more.

Since:
0.1
Author:
Lachlan Aldred
Created/Last Date:
17/04/2003

Method Summary
 void add(YPersistenceManager pmgr, YIdentifier id)
          Add an identifier to the condition.
 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.
 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.
 

Method Detail

contains

boolean contains(YIdentifier identifier)
Check whether a condition contains the specified identifier.

Parameters:
identifier - the identifier in question.
Returns:
true iff this contains identifier.

containsIdentifier

boolean containsIdentifier()
Check whether a condition has at least one identifier.

Returns:
true iff this contains one or more identifier.

getAmount

int getAmount(YIdentifier identifier)
Get the number of identifiers in a condition that match the specified identifier.

Parameters:
identifier - the identifier in question.
Returns:
the number of equal identifiers in the condition.

getIdentifiers

List<YIdentifier> getIdentifiers()
Get all the identifiers in a condition.

Returns:
a List of the identifiers in the condition.

removeOne

YIdentifier removeOne(YPersistenceManager pmgr)
                      throws RuntimeException,
                             YPersistenceException
Remove one identifier from the condition. If there are none to remove then make no change to the condition's state.

Parameters:
pmgr - an instantiated persistence manager object.
Returns:
the identifier that has been removed.
Throws:
RuntimeException - if there's a problem removing the identifier.
YPersistenceException - if there's a problem persisting the change.

removeOne

void removeOne(YPersistenceManager pmgr,
               YIdentifier identifier)
               throws YPersistenceException
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.

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

void remove(YPersistenceManager pmgr,
            YIdentifier identifier,
            int amount)
            throws YStateException,
                   YPersistenceException
Remove a specified number of identifiers equal to the specified identifier from the condition.

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:
YStateException - if the amount specified is greater than the number of identifiers held inside the condition, and furthermore no change will be made to the state of this.
YPersistenceException - if there's a problem persisting the change.

removeAll

void removeAll(YPersistenceManager pmgr,
               YIdentifier identifier)
               throws YPersistenceException
Remove all the identifiers that match the specified identifier.

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

void removeAll(YPersistenceManager pmgr)
               throws YPersistenceException
Remove all the identifiers in the condition.

Parameters:
pmgr - an instantiated persistence manager object.
Throws:
YPersistenceException - if there's a problem persisting the change.

add

void add(YPersistenceManager pmgr,
         YIdentifier id)
         throws YPersistenceException
Add an identifier to the condition.

Parameters:
pmgr - an instantiated persistence manager object.
id - the identifier to add.
Throws:
YPersistenceException - if there's a problem persisting the change.


Copyright © 2004-2012 The YAWL Foundation.