net.ontopia.topicmaps.query.impl.utils
Class PredicateDrivenCostEstimator

java.lang.Object
  extended by net.ontopia.topicmaps.query.impl.utils.CostEstimator
      extended by net.ontopia.topicmaps.query.impl.utils.PredicateDrivenCostEstimator

public class PredicateDrivenCostEstimator
extends CostEstimator


Field Summary
static int BIG_RESULT
           
static int FAIL_RESULT
           
static int FILTER_RESULT
           
static int INFINITE_RESULT
           
static int MEDIUM_RESULT
           
static int SINGLE_RESULT
           
static int SMALL_RESULT
           
static int WHOLE_TM_RESULT
           
 
Constructor Summary
PredicateDrivenCostEstimator()
           
 
Method Summary
 int computeCost(java.util.Set context, AbstractClause clause, java.util.Set literalvars, java.lang.String rulename)
          INTERNAL: Computes the cost of evaluating the given clause in the given context of variable bindings.
static int getComparisonPredicateCost(boolean[] boundparams)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFINITE_RESULT

public static int INFINITE_RESULT

WHOLE_TM_RESULT

public static int WHOLE_TM_RESULT

BIG_RESULT

public static int BIG_RESULT

MEDIUM_RESULT

public static int MEDIUM_RESULT

SMALL_RESULT

public static int SMALL_RESULT

SINGLE_RESULT

public static int SINGLE_RESULT

FILTER_RESULT

public static int FILTER_RESULT

FAIL_RESULT

public static int FAIL_RESULT
Constructor Detail

PredicateDrivenCostEstimator

public PredicateDrivenCostEstimator()
Method Detail

computeCost

public int computeCost(java.util.Set context,
                       AbstractClause clause,
                       java.util.Set literalvars,
                       java.lang.String rulename)
INTERNAL: Computes the cost of evaluating the given clause in the given context of variable bindings. The cost largely depends on the number of unbound variables in the clause.

Specified by:
computeCost in class CostEstimator
Parameters:
context - A set of bound variables.
clause - The clause whose cost we want to compute.
literalvars - Contains the variables representing literals. Only an issue in rules.
rulename - The name of the current rule (so we can delay recursive evaluation).

getComparisonPredicateCost

public static int getComparisonPredicateCost(boolean[] boundparams)


Copyright © 2000-2012 Ontopia.