Class CostEstimateImpl
java.lang.Object
org.apache.derby.impl.sql.compile.CostEstimateImpl
- All Implemented Interfaces:
CostEstimate, StoreCostResult
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) double(package private) double(package private) double -
Constructor Summary
ConstructorsConstructorDescriptionCostEstimateImpl(double theCost, double theRowCount, double theSingleScanRowCount) -
Method Summary
Modifier and TypeMethodDescriptionadd(CostEstimate other, CostEstimate retval) Add this cost estimate to another one.cloneMe()Get a copy of this CostEstimatedoublecompare(CostEstimate other) Compare this cost estimate with the given cost estimate.divide(double divisor, CostEstimate retval) Divide this cost estimate by a scalar, non-dimensional number.doubleGet the estimated cost.longGet the estimated row count.booleanReturn whether or not this CostEstimate is uninitialized.multiply(double multiplicand, CostEstimate retval) Multiply this cost estimate by a scalar, non-dimensional number.doublerowCount()Get the estimated number of rows returned by the ResultSet that this CostEstimate models.voidsetCost(double cost, double rowCount, double singleScanRowCount) Set the cost for this cost estimate.voidsetCost(CostEstimate other) Copy the values from the given cost estimate into this one.voidsetEstimatedCost(double cost) Set the estimated cost.voidsetEstimatedRowCount(long count) Set the estimated row count.voidsetSingleScanRowCount(double singleScanRowCount) Set the single scan row count.(package private) CostEstimateImplsetState(double theCost, double theRowCount, CostEstimateImpl retval) doubleGet the estimated number of rows returned by a single scan of the ResultSet that this CostEstimate models.toString()
-
Field Details
-
cost
double cost -
rowCount
double rowCount -
singleScanRowCount
double singleScanRowCount
-
-
Constructor Details
-
CostEstimateImpl
CostEstimateImpl() -
CostEstimateImpl
CostEstimateImpl(double theCost, double theRowCount, double theSingleScanRowCount)
-
-
Method Details
-
setCost
public void setCost(double cost, double rowCount, double singleScanRowCount) Description copied from interface:CostEstimateSet the cost for this cost estimate.- Specified by:
setCostin interfaceCostEstimate- See Also:
-
setCost
Description copied from interface:CostEstimateCopy the values from the given cost estimate into this one.- Specified by:
setCostin interfaceCostEstimate- See Also:
-
setSingleScanRowCount
public void setSingleScanRowCount(double singleScanRowCount) Description copied from interface:CostEstimateSet the single scan row count.- Specified by:
setSingleScanRowCountin interfaceCostEstimate- See Also:
-
compare
Description copied from interface:CostEstimateCompare this cost estimate with the given cost estimate.- Specified by:
comparein interfaceCostEstimate- Parameters:
other- The cost estimate to compare this one with- Returns:
- < 0 if this < other, 0 if this == other, > 0 if this > other
- See Also:
-
add
Description copied from interface:CostEstimateAdd this cost estimate to another one. This presumes that any row ordering is destroyed.- Specified by:
addin interfaceCostEstimate- Parameters:
other- This cost estimate to add this one to.retval- If non-null, put the result here.- Returns:
- this + other.
- See Also:
-
multiply
Description copied from interface:CostEstimateMultiply this cost estimate by a scalar, non-dimensional number. This presumes that any row ordering is destroyed.- Specified by:
multiplyin interfaceCostEstimate- Parameters:
multiplicand- The value to multiply this CostEstimate by.retval- If non-null, put the result here.- Returns:
- this * multiplicand
- See Also:
-
divide
Description copied from interface:CostEstimateDivide this cost estimate by a scalar, non-dimensional number.- Specified by:
dividein interfaceCostEstimate- Parameters:
divisor- The value to divide this CostEstimate by.retval- If non-null, put the result here.- Returns:
- this / divisor
- See Also:
-
rowCount
public double rowCount()Description copied from interface:CostEstimateGet the estimated number of rows returned by the ResultSet that this CostEstimate models.- Specified by:
rowCountin interfaceCostEstimate- See Also:
-
singleScanRowCount
public double singleScanRowCount()Description copied from interface:CostEstimateGet the estimated number of rows returned by a single scan of the ResultSet that this CostEstimate models.- Specified by:
singleScanRowCountin interfaceCostEstimate- See Also:
-
cloneMe
Description copied from interface:CostEstimateGet a copy of this CostEstimate- Specified by:
cloneMein interfaceCostEstimate- See Also:
-
isUninitialized
public boolean isUninitialized()Description copied from interface:CostEstimateReturn whether or not this CostEstimate is uninitialized.- Specified by:
isUninitializedin interfaceCostEstimate- Returns:
- Whether or not this CostEstimate is uninitialized.
- See Also:
-
getEstimatedCost
public double getEstimatedCost()Description copied from interface:StoreCostResultGet the estimated cost.- Specified by:
getEstimatedCostin interfaceStoreCostResult- See Also:
-
setEstimatedCost
public void setEstimatedCost(double cost) Description copied from interface:StoreCostResultSet the estimated cost.- Specified by:
setEstimatedCostin interfaceStoreCostResult- See Also:
-
getEstimatedRowCount
public long getEstimatedRowCount()Description copied from interface:StoreCostResultGet the estimated row count.- Specified by:
getEstimatedRowCountin interfaceStoreCostResult- See Also:
-
setEstimatedRowCount
public void setEstimatedRowCount(long count) Description copied from interface:StoreCostResultSet the estimated row count.- Specified by:
setEstimatedRowCountin interfaceStoreCostResult- See Also:
-
setState
-
toString
-