org.appdapter.api.registry
Interface SimpleFinder<OT>

All Superinterfaces:
Finder<OT>
All Known Implementing Classes:
BasicFinder

public interface SimpleFinder<OT>
extends Finder<OT>

Additional Finder methods which do not require the user to supply a Receiver.

Author:
Stu B.

Field Summary
static int MAX_MATCHES
           
 
Method Summary
 long countMatches(Pattern p, int maxAllowed)
          Count the number of available matches, but throw an exception if count goes strictly higher than maxAllowed.
 List<OT> findAllMatches(Pattern p, int minAllowed, int maxAllowed)
          Find all matches, and return in an arbitrary order, but will throw an exception if available number of matches for the pattern is not within closed (inclusive) interval [minAllowed, maxAllowed].
 OT findFirstMatch(Pattern p, int minAllowed, int maxAllowed)
          Seeks only one match, chosen arbitrarily from available matches, but will throw an exception if available number of matches for the pattern is not within closed (inclusive) interval [minAllowed, maxAllowed].
 
Methods inherited from interface org.appdapter.api.registry.Finder
deliverMatchesUntilDone, killDeliverySequence
 

Field Detail

MAX_MATCHES

static final int MAX_MATCHES
See Also:
Constant Field Values
Method Detail

findFirstMatch

OT findFirstMatch(Pattern p,
                  int minAllowed,
                  int maxAllowed)
                  throws Exception
Seeks only one match, chosen arbitrarily from available matches, but will throw an exception if available number of matches for the pattern is not within closed (inclusive) interval [minAllowed, maxAllowed].

Parameters:
p - pattern which must be matched by the registered object descriptions.
minAllowed - the minimum number of matches allowed for this Pattern.
maxAllowed - the maximum number of matches allowed for this Pattern.
Returns:
first match, null, or throw, depdending on min/max allowed.
Throws:
Exception

findAllMatches

List<OT> findAllMatches(Pattern p,
                        int minAllowed,
                        int maxAllowed)
                        throws Exception
Find all matches, and return in an arbitrary order, but will throw an exception if available number of matches for the pattern is not within closed (inclusive) interval [minAllowed, maxAllowed].

Parameters:
p - pattern which must be matched by the registered object description. *
minAllowed - minimum number of matches allowed for this Pattern.
maxAllowed - maximum number of matches allowed for this Pattern.
Returns:
first match, null, or throw, depdending on min/max allowed.
Throws:
Exception

countMatches

long countMatches(Pattern p,
                  int maxAllowed)
                  throws Exception
Count the number of available matches, but throw an exception if count goes strictly higher than maxAllowed.

Parameters:
maxAllowed - maximum number of matches allowed for this Pattern.
Returns:
first match, null, or throw, depdending on min/max allowed.
Throws:
Exception


Copyright © 2010-2012. All Rights Reserved.