org.wamblee.conditions
Class OrCondition<T>

java.lang.Object
  extended by org.wamblee.conditions.OrCondition<T>
All Implemented Interfaces:
Condition<T>

public class OrCondition<T>
extends Object
implements Condition<T>

Represents a logical or of different boolean conditions.

Author:
Erik Brakkee

Constructor Summary
OrCondition(Condition<T> aCondition1, Condition<T> aCondition2)
          Constructs the condition.
OrCondition(List<Condition<T>> aConditions)
          Constructs the or condition.
 
Method Summary
 boolean matches(T aObject)
          Determines if an object matches a condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrCondition

public OrCondition(Condition<T> aCondition1,
                   Condition<T> aCondition2)
Constructs the condition.

Parameters:
aCondition1 - First condition.
aCondition2 - Second condition.

OrCondition

public OrCondition(List<Condition<T>> aConditions)
Constructs the or condition.

Parameters:
aConditions - List of conditions to use in the logical or.
Method Detail

matches

public boolean matches(T aObject)
Description copied from interface: Condition
Determines if an object matches a condition.

Specified by:
matches in interface Condition<T>
Parameters:
aObject - object to match.
Returns:
True iff the object matches.


Copyright © 2011. All Rights Reserved.