blog
Class AbstractQuery

java.lang.Object
  extended by blog.AbstractQuery
All Implemented Interfaces:
Query
Direct Known Subclasses:
ArgSpecQuery

public abstract class AbstractQuery
extends java.lang.Object
implements Query

An implementation of Query that defines default implementations to some methods.


Constructor Summary
AbstractQuery()
           
 
Method Summary
 java.lang.Object getLocation()
          Returns an object whose toString method yields a description of the location where this query occurred in an input file.
 void logResults(int numSamples)
          If a log file has been specified, prints the results so far to that file.
 void setPosterior(ve.Factor posterior)
          Throws an UnsupportedOperationException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface blog.Query
checkTypesAndScope, compile, getVariables, printResults, printVarianceResults, updateStats, zeroOut
 

Constructor Detail

AbstractQuery

public AbstractQuery()
Method Detail

setPosterior

public void setPosterior(ve.Factor posterior)
Throws an UnsupportedOperationException.

Specified by:
setPosterior in interface Query
Parameters:
posterior - factor whose set of variables is the same as the collection returned by getVariables, and whose entries sum to 1

logResults

public void logResults(int numSamples)
If a log file has been specified, prints the results so far to that file.

This default implementation does nothing.

Specified by:
logResults in interface Query
Parameters:
numSamples - the number of samples taken by the inference engine so far (can be set to zero for non-sampling inference engines)

getLocation

public java.lang.Object getLocation()
Returns an object whose toString method yields a description of the location where this query occurred in an input file.

This default implementation returns a string indicating that this query was generated internally, rather than from an input file.

Specified by:
getLocation in interface Query