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 CostEstimatedouble
compare
(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.double
Get the estimated cost.long
Get the estimated row count.boolean
Return whether or not this CostEstimate is uninitialized.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
Get 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:CostEstimate
Set the cost for this cost estimate.- Specified by:
setCost
in interfaceCostEstimate
- See Also:
-
setCost
Description copied from interface:CostEstimate
Copy the values from the given cost estimate into this one.- Specified by:
setCost
in interfaceCostEstimate
- See Also:
-
setSingleScanRowCount
public void setSingleScanRowCount(double singleScanRowCount) Description copied from interface:CostEstimate
Set the single scan row count.- Specified by:
setSingleScanRowCount
in interfaceCostEstimate
- See Also:
-
compare
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:
-
add
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:
-
multiply
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:
-
divide
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:
-
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:
-
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:
-
cloneMe
Description copied from interface:CostEstimate
Get a copy of this CostEstimate- Specified by:
cloneMe
in interfaceCostEstimate
- See Also:
-
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:
-
getEstimatedCost
public double getEstimatedCost()Description copied from interface:StoreCostResult
Get the estimated cost.- Specified by:
getEstimatedCost
in interfaceStoreCostResult
- See Also:
-
setEstimatedCost
public void setEstimatedCost(double cost) Description copied from interface:StoreCostResult
Set the estimated cost.- Specified by:
setEstimatedCost
in interfaceStoreCostResult
- See Also:
-
getEstimatedRowCount
public long getEstimatedRowCount()Description copied from interface:StoreCostResult
Get the estimated row count.- Specified by:
getEstimatedRowCount
in interfaceStoreCostResult
- See Also:
-
setEstimatedRowCount
public void setEstimatedRowCount(long count) Description copied from interface:StoreCostResult
Set the estimated row count.- Specified by:
setEstimatedRowCount
in interfaceStoreCostResult
- See Also:
-
setState
-
toString
-