antsnest.datastructure
Class ConditionList

java.lang.Object
  extended by antsnest.datastructure.ConditionList
All Implemented Interfaces:
Serializable

public class ConditionList
extends Object
implements Serializable

A list of conditions

Author:
Chris Clohosy
See Also:
Condition, Serialized Form

Constructor Summary
ConditionList()
          Constructs a new condition list
 
Method Summary
 void addCondition(Condition condition)
          Adds a condition to the list
 boolean areConditionsMet()
          Calculates whether all the conditions are met
 Condition getCondition(int position)
          Gets a condition from the list
 int getLength()
          Gets the length of the list
 void updateConditions(ChangeEvent event)
          Updates conditions when a new event is received
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionList

public ConditionList()
Constructs a new condition list

Method Detail

addCondition

public void addCondition(Condition condition)
Adds a condition to the list

Parameters:
condition - the condition to add

getCondition

public Condition getCondition(int position)
Gets a condition from the list

Parameters:
position - the index of the condition to get
Returns:
a Condition, the required condition

getLength

public int getLength()
Gets the length of the list

Returns:
an int, the length

areConditionsMet

public boolean areConditionsMet()
Calculates whether all the conditions are met

Returns:
a boolean, whether they have been met

updateConditions

public void updateConditions(ChangeEvent event)
Updates conditions when a new event is received

Parameters:
event - the new event that has occured