net.sourceforge.javamatch.query
Class Minimum

java.lang.Object
  extended bynet.sourceforge.javamatch.query.MatchQuery
      extended bynet.sourceforge.javamatch.query.NumericQuery
          extended bynet.sourceforge.javamatch.query.Minimum

public class Minimum
extends NumericQuery

Class Minimum is a query that compares the value of an instance varaible with the values of the same variable in other instances. It returns an indication how near the value is to the global minimum


Constructor Summary
Minimum(java.lang.String memberName)
          Creates a new Minimum-query, that compares the given member name with the given match value
 
Method Summary
 float getMatchValue(java.lang.Object matchedObject)
          Returns the match value of this match query, when executed on the given object.
 boolean isTwoPass()
          Returns if this MatchQuery is two-pass.
 void prePass(java.lang.Object matchedObject)
          Performs the pre-pass of this two-pass query.
 
Methods inherited from class net.sourceforge.javamatch.query.NumericQuery
getValue
 
Methods inherited from class net.sourceforge.javamatch.query.MatchQuery
getObjectValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Minimum

public Minimum(java.lang.String memberName)
Creates a new Minimum-query, that compares the given member name with the given match value

Parameters:
memberName - the name of the member that is matched
Method Detail

isTwoPass

public boolean isTwoPass()
Returns if this MatchQuery is two-pass. When the query is two-pass, a call to prePass will be made for every object, before the matchValue is requested

Overrides:
isTwoPass in class MatchQuery
Returns:
true, this query is two-pass

prePass

public void prePass(java.lang.Object matchedObject)
             throws MatchException
Performs the pre-pass of this two-pass query.

Overrides:
prePass in class MatchQuery
Parameters:
matchedObject - the object theat is currently matched
Throws:
MatchException - when the prePass failed

getMatchValue

public float getMatchValue(java.lang.Object matchedObject)
                    throws MatchException
Returns the match value of this match query, when executed on the given object.

Specified by:
getMatchValue in class MatchQuery
Parameters:
matchedObject - the object agains which the query is executed
Returns:
A value between 0 and 1, both inclusive, that indicates how good the object matches this query. 0 means a mismatch, 1 means a full match
Throws:
MatchException - when the value could not be retrieved

Hosted by SourceForge.net/