net.sf.myra.framework
Class CompoundStopCondition

java.lang.Object
  extended by net.sf.myra.framework.CompoundStopCondition
All Implemented Interfaces:
StopCondition

public class CompoundStopCondition
extends java.lang.Object
implements StopCondition

This class represents a stop condition made by the combination of several stop conditions.

Version:
$Revision$ $Date: 2008-02-08 15:54:20#$
Author:
Fernando Esteban Barril Otero

Nested Class Summary
static class CompoundStopCondition.Type
          Represents the type of the test applied.
 
Constructor Summary
CompoundStopCondition()
          Creates a new CompoundStopCondition instance.
CompoundStopCondition(CompoundStopCondition.Type type)
          Creates a new CompoundStopCondition instance.
 
Method Summary
 void add(StopCondition condition)
          Adds the specified condition.
 boolean isReached(Environment environment)
          Checks if the colony within the specified environment has reached this stop criteria.
 void remove(StopCondition condition)
          Removes the specified condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundStopCondition

public CompoundStopCondition()
Creates a new CompoundStopCondition instance.


CompoundStopCondition

public CompoundStopCondition(CompoundStopCondition.Type type)
Creates a new CompoundStopCondition instance.

Parameters:
type - the stoping criteria type.
Method Detail

add

public void add(StopCondition condition)
Adds the specified condition.

Parameters:
condition - the condition to add.

remove

public void remove(StopCondition condition)
Removes the specified condition.

Parameters:
condition - the condition to remove.

isReached

public boolean isReached(Environment environment)
Description copied from interface: StopCondition
Checks if the colony within the specified environment has reached this stop criteria.

Specified by:
isReached in interface StopCondition
Parameters:
environment - the colony's environment
Returns:
true if the colony within the envorinment has reached this stop criteria; false otherwise.


Copyright © 2013. All Rights Reserved.