Class PredicateDrivenCostEstimator
- java.lang.Object
-
- net.ontopia.topicmaps.query.impl.utils.CostEstimator
-
- net.ontopia.topicmaps.query.impl.utils.PredicateDrivenCostEstimator
-
public class PredicateDrivenCostEstimator extends CostEstimator
-
-
Field Summary
Fields Modifier and Type Field Description static intBIG_RESULTstatic intFAIL_RESULTstatic intFILTER_RESULTstatic intINFINITE_RESULTstatic intMEDIUM_RESULTstatic intSINGLE_RESULTstatic intSMALL_RESULTstatic intWHOLE_TM_RESULT
-
Constructor Summary
Constructors Constructor Description PredicateDrivenCostEstimator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcomputeCost(Set context, AbstractClause clause, Set literalvars, String rulename)INTERNAL: Computes the cost of evaluating the given clause in the given context of variable bindings.static intgetComparisonPredicateCost(boolean[] boundparams)
-
-
-
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
-
-
Method Detail
-
computeCost
public int computeCost(Set context, AbstractClause clause, Set literalvars, 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:
computeCostin classCostEstimator- 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)
-
-