org.picocontainer.gems.constraints
Class Or

java.lang.Object
  extended by org.picocontainer.defaults.CollectionComponentParameter
      extended by org.picocontainer.gems.constraints.AbstractConstraint
          extended by org.picocontainer.gems.constraints.Or
All Implemented Interfaces:
java.io.Serializable, Constraint, org.picocontainer.Parameter

public class Or
extends AbstractConstraint

Aggregates multiple constraints together using boolean OR logic. Constraints are short-circuited as in java.

Version:
1.1
Author:
Nick Sieger
See Also:
Serialized Form

Field Summary
private  Constraint[] children
           
 
Fields inherited from class org.picocontainer.defaults.CollectionComponentParameter
ARRAY, ARRAY_ALLOW_EMPTY
 
Constructor Summary
Or(Constraint[] cc)
           
Or(Constraint c1, Constraint c2)
           
Or(Constraint c1, Constraint c2, Constraint c3)
           
 
Method Summary
 void accept(org.picocontainer.PicoVisitor visitor)
           
 boolean evaluate(org.picocontainer.ComponentAdapter adapter)
          Evaluate whether the given component adapter matches this constraint.
 
Methods inherited from class org.picocontainer.gems.constraints.AbstractConstraint
getMatchingComponentAdapters, isResolvable, resolveInstance, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

private Constraint[] children
Constructor Detail

Or

public Or(Constraint c1,
          Constraint c2)

Or

public Or(Constraint c1,
          Constraint c2,
          Constraint c3)

Or

public Or(Constraint[] cc)
Method Detail

evaluate

public boolean evaluate(org.picocontainer.ComponentAdapter adapter)
Description copied from interface: Constraint
Evaluate whether the given component adapter matches this constraint.

Specified by:
evaluate in interface Constraint
Specified by:
evaluate in class AbstractConstraint
Parameters:
adapter - a ComponentAdapter value
Returns:
true if the adapter matches the constraint

accept

public void accept(org.picocontainer.PicoVisitor visitor)
Specified by:
accept in interface org.picocontainer.Parameter
Overrides:
accept in class org.picocontainer.defaults.CollectionComponentParameter