Class CostEstimateImpl
- java.lang.Object
-
- org.apache.derby.impl.sql.compile.CostEstimateImpl
-
- All Implemented Interfaces:
CostEstimate,StoreCostResult
class CostEstimateImpl extends java.lang.Object implements CostEstimate
-
-
Field Summary
Fields Modifier and Type Field Description (package private) doublecost(package private) doublerowCount(package private) doublesingleScanRowCount
-
Constructor Summary
Constructors Constructor Description CostEstimateImpl()CostEstimateImpl(double theCost, double theRowCount, double theSingleScanRowCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CostEstimateadd(CostEstimate other, CostEstimate retval)Add this cost estimate to another one.CostEstimatecloneMe()Get a copy of this CostEstimatedoublecompare(CostEstimate other)Compare this cost estimate with the given cost estimate.CostEstimatedivide(double divisor, CostEstimate retval)Divide this cost estimate by a scalar, non-dimensional number.doublegetEstimatedCost()Get the estimated cost.longgetEstimatedRowCount()Get the estimated row count.booleanisUninitialized()Return whether or not this CostEstimate is uninitialized.CostEstimatemultiply(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)doublesingleScanRowCount()Get the estimated number of rows returned by a single scan of the ResultSet that this CostEstimate models.java.lang.StringtoString()
-
-
-
Method Detail
-
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:
CostEstimate.setCost(double, double, double)
-
setCost
public void setCost(CostEstimate other)
Description copied from interface:CostEstimateCopy the values from the given cost estimate into this one.- Specified by:
setCostin interfaceCostEstimate- See Also:
CostEstimate.setCost(double, double, double)
-
setSingleScanRowCount
public void setSingleScanRowCount(double singleScanRowCount)
Description copied from interface:CostEstimateSet the single scan row count.- Specified by:
setSingleScanRowCountin interfaceCostEstimate- See Also:
CostEstimate.setSingleScanRowCount(double)
-
compare
public double compare(CostEstimate other)
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:
CostEstimate.compare(org.apache.derby.iapi.sql.compile.CostEstimate)
-
add
public CostEstimate add(CostEstimate other, CostEstimate retval)
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:
CostEstimate.add(org.apache.derby.iapi.sql.compile.CostEstimate, org.apache.derby.iapi.sql.compile.CostEstimate)
-
multiply
public CostEstimate multiply(double multiplicand, CostEstimate retval)
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:
CostEstimate.multiply(double, org.apache.derby.iapi.sql.compile.CostEstimate)
-
divide
public CostEstimate divide(double divisor, CostEstimate retval)
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:
CostEstimate.divide(double, org.apache.derby.iapi.sql.compile.CostEstimate)
-
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:
CostEstimate.rowCount()
-
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:
CostEstimate.singleScanRowCount()
-
cloneMe
public CostEstimate cloneMe()
Description copied from interface:CostEstimateGet a copy of this CostEstimate- Specified by:
cloneMein interfaceCostEstimate- See Also:
CostEstimate.cloneMe()
-
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:
CostEstimate.isUninitialized()
-
getEstimatedCost
public double getEstimatedCost()
Description copied from interface:StoreCostResultGet the estimated cost.- Specified by:
getEstimatedCostin interfaceStoreCostResult- See Also:
StoreCostResult.getEstimatedCost()
-
setEstimatedCost
public void setEstimatedCost(double cost)
Description copied from interface:StoreCostResultSet the estimated cost.- Specified by:
setEstimatedCostin interfaceStoreCostResult- See Also:
StoreCostResult.setEstimatedCost(double)
-
getEstimatedRowCount
public long getEstimatedRowCount()
Description copied from interface:StoreCostResultGet the estimated row count.- Specified by:
getEstimatedRowCountin interfaceStoreCostResult- See Also:
StoreCostResult.getEstimatedRowCount()
-
setEstimatedRowCount
public void setEstimatedRowCount(long count)
Description copied from interface:StoreCostResultSet the estimated row count.- Specified by:
setEstimatedRowCountin interfaceStoreCostResult- See Also:
StoreCostResult.setEstimatedRowCount(long)
-
setState
CostEstimateImpl setState(double theCost, double theRowCount, CostEstimateImpl retval)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-