org.wamblee.conditions
Class AndCondition<T>

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

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

Represents a logical and of different boolean conditions.

Author:
Erik Brakkee

Constructor Summary
AndCondition(Condition<T> aCondition1, Condition<T> aCondition2)
          Constructs the condition.
AndCondition(List<Condition<T>> aConditions)
          Constructs the and 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

AndCondition

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

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

AndCondition

public AndCondition(List<Condition<T>> aConditions)
Constructs the and condition.

Parameters:
aConditions - List of conditions to use in the logical and.
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.