anl.aida.query
Class ConstantQuery

java.lang.Object
  extended by anl.aida.query.ConstantQuery
All Implemented Interfaces:
Query

public class ConstantQuery
extends java.lang.Object
implements Query

A Query that always returns a constant numeric value.

Author:
Nick Collier

Field Summary
private  float val
           
 
Constructor Summary
ConstantQuery(float val)
          Creates a ConstantQuery that returns the specified val on execution.
 
Method Summary
 float execute(anl.aida.core.ScoredTermsCollection stc)
          Executes this query on the specified ScoredTermsCollection and returns a numeric value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

val

private float val
Constructor Detail

ConstantQuery

public ConstantQuery(float val)
Creates a ConstantQuery that returns the specified val on execution.

Parameters:
val - the constant value to return
Method Detail

execute

public float execute(anl.aida.core.ScoredTermsCollection stc)
Description copied from interface: Query
Executes this query on the specified ScoredTermsCollection and returns a numeric value.

Specified by:
execute in interface Query
Parameters:
stc - the collection to execute against
Returns:
the result of the query.