games.strategy.util
Class CompositeMatch<T>

java.lang.Object
  extended by games.strategy.util.Match<T>
      extended by games.strategy.util.CompositeMatch<T>
Direct Known Subclasses:
CompositeMatchAnd, CompositeMatchOr

public abstract class CompositeMatch<T>
extends Match<T>

Base class for composite matches.
Can add a match, or an inverse match.
Subclasses must override match, and can call getMatches() to get a list of matches added.

Version:
1.0
Author:
Sean Bridges

Field Summary
 
Fields inherited from class games.strategy.util.Match
ALWAYS_MATCH, NEVER_MATCH
 
Constructor Summary
CompositeMatch()
          Creates new CompositeMatch
 
Method Summary
 void add(Match<T> match)
          Add a match.
 void addInverse(Match<T> aMatch)
          Add the inverse of a match.
protected  java.util.List<Match<T>> getMatches()
          Returns the matches, does not return a copy so be careful about modifying.
 
Methods inherited from class games.strategy.util.Match
allMatch, countMatches, getKeysWhereValueMatch, getMatches, getNMatches, invert, match, noneMatch, someMatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeMatch

public CompositeMatch()
Creates new CompositeMatch

Method Detail

add

public void add(Match<T> match)
Add a match.


addInverse

public void addInverse(Match<T> aMatch)
Add the inverse of a match. Equivalant to add(new InverseMatch(aMatch))


getMatches

protected java.util.List<Match<T>> getMatches()
Returns the matches, does not return a copy so be careful about modifying. Also note this could be regenerated when new matches are added.