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) double
cost
(package private) double
rowCount
(package private) double
singleScanRowCount
-
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 CostEstimate
add(CostEstimate other, CostEstimate retval)
Add this cost estimate to another one.CostEstimate
cloneMe()
Get a copy of this CostEstimatedouble
compare(CostEstimate other)
Compare this cost estimate with the given cost estimate.CostEstimate
divide(double divisor, CostEstimate retval)
Divide this cost estimate by a scalar, non-dimensional number.double
getEstimatedCost()
Get the estimated cost.long
getEstimatedRowCount()
Get the estimated row count.boolean
isUninitialized()
Return whether or not this CostEstimate is uninitialized.CostEstimate
multiply(double multiplicand, CostEstimate retval)
Multiply this cost estimate by a scalar, non-dimensional number.double
rowCount()
Get the estimated number of rows returned by the ResultSet that this CostEstimate models.void
setCost(double cost, double rowCount, double singleScanRowCount)
Set the cost for this cost estimate.void
setCost(CostEstimate other)
Copy the values from the given cost estimate into this one.void
setEstimatedCost(double cost)
Set the estimated cost.void
setEstimatedRowCount(long count)
Set the estimated row count.void
setSingleScanRowCount(double singleScanRowCount)
Set the single scan row count.(package private) CostEstimateImpl
setState(double theCost, double theRowCount, CostEstimateImpl retval)
double
singleScanRowCount()
Get the estimated number of rows returned by a single scan of the ResultSet that this CostEstimate models.java.lang.String
toString()
-
-
-
Method Detail
-
setCost
public void setCost(double cost, double rowCount, double singleScanRowCount)
Description copied from interface:CostEstimate
Set the cost for this cost estimate.- Specified by:
setCost
in interfaceCostEstimate
- See Also:
CostEstimate.setCost(double, double, double)
-
setCost
public void setCost(CostEstimate other)
Description copied from interface:CostEstimate
Copy the values from the given cost estimate into this one.- Specified by:
setCost
in interfaceCostEstimate
- See Also:
CostEstimate.setCost(double, double, double)
-
setSingleScanRowCount
public void setSingleScanRowCount(double singleScanRowCount)
Description copied from interface:CostEstimate
Set the single scan row count.- Specified by:
setSingleScanRowCount
in interfaceCostEstimate
- See Also:
CostEstimate.setSingleScanRowCount(double)
-
compare
public double compare(CostEstimate other)
Description copied from interface:CostEstimate
Compare this cost estimate with the given cost estimate.- Specified by:
compare
in 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:CostEstimate
Add this cost estimate to another one. This presumes that any row ordering is destroyed.- Specified by:
add
in 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:CostEstimate
Multiply this cost estimate by a scalar, non-dimensional number. This presumes that any row ordering is destroyed.- Specified by:
multiply
in 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:CostEstimate
Divide this cost estimate by a scalar, non-dimensional number.- Specified by:
divide
in 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:CostEstimate
Get the estimated number of rows returned by the ResultSet that this CostEstimate models.- Specified by:
rowCount
in interfaceCostEstimate
- See Also:
CostEstimate.rowCount()
-
singleScanRowCount
public double singleScanRowCount()
Description copied from interface:CostEstimate
Get the estimated number of rows returned by a single scan of the ResultSet that this CostEstimate models.- Specified by:
singleScanRowCount
in interfaceCostEstimate
- See Also:
CostEstimate.singleScanRowCount()
-
cloneMe
public CostEstimate cloneMe()
Description copied from interface:CostEstimate
Get a copy of this CostEstimate- Specified by:
cloneMe
in interfaceCostEstimate
- See Also:
CostEstimate.cloneMe()
-
isUninitialized
public boolean isUninitialized()
Description copied from interface:CostEstimate
Return whether or not this CostEstimate is uninitialized.- Specified by:
isUninitialized
in interfaceCostEstimate
- Returns:
- Whether or not this CostEstimate is uninitialized.
- See Also:
CostEstimate.isUninitialized()
-
getEstimatedCost
public double getEstimatedCost()
Description copied from interface:StoreCostResult
Get the estimated cost.- Specified by:
getEstimatedCost
in interfaceStoreCostResult
- See Also:
StoreCostResult.getEstimatedCost()
-
setEstimatedCost
public void setEstimatedCost(double cost)
Description copied from interface:StoreCostResult
Set the estimated cost.- Specified by:
setEstimatedCost
in interfaceStoreCostResult
- See Also:
StoreCostResult.setEstimatedCost(double)
-
getEstimatedRowCount
public long getEstimatedRowCount()
Description copied from interface:StoreCostResult
Get the estimated row count.- Specified by:
getEstimatedRowCount
in interfaceStoreCostResult
- See Also:
StoreCostResult.getEstimatedRowCount()
-
setEstimatedRowCount
public void setEstimatedRowCount(long count)
Description copied from interface:StoreCostResult
Set the estimated row count.- Specified by:
setEstimatedRowCount
in interfaceStoreCostResult
- See Also:
StoreCostResult.setEstimatedRowCount(long)
-
setState
CostEstimateImpl setState(double theCost, double theRowCount, CostEstimateImpl retval)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-