org.apache.derby.impl.sql.compile
Class CostEstimateImpl

java.lang.Object
  extended by org.apache.derby.impl.sql.compile.CostEstimateImpl
All Implemented Interfaces:
CostEstimate, StoreCostResult
Direct Known Subclasses:
Level2CostEstimateImpl

public class CostEstimateImpl
extends java.lang.Object
implements CostEstimate


Field Summary
 double cost
           
 double rowCount
           
 double singleScanRowCount
           
 
Constructor Summary
CostEstimateImpl()
           
CostEstimateImpl(double theCost, double theRowCount, double theSingleScanRowCount)
           
 
Method Summary
 CostEstimate add(CostEstimate other, CostEstimate retval)
          Add this cost estimate to another one.
 CostEstimate cloneMe()
          Get a copy of this CostEstimate
 double 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(CostEstimate other)
          Copy the values from the given cost estimate into this one.
 void setCost(double cost, double rowCount, double singleScanRowCount)
          Set the cost for this cost estimate.
 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.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cost

public double cost

rowCount

public double rowCount

singleScanRowCount

public double singleScanRowCount
Constructor Detail

CostEstimateImpl

public CostEstimateImpl()

CostEstimateImpl

public CostEstimateImpl(double theCost,
                        double theRowCount,
                        double theSingleScanRowCount)
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 interface CostEstimate
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 interface CostEstimate
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 interface CostEstimate
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 interface CostEstimate
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 interface CostEstimate
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 interface CostEstimate
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 interface CostEstimate
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 interface CostEstimate
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 interface CostEstimate
See Also:
CostEstimate.singleScanRowCount()

cloneMe

public CostEstimate cloneMe()
Description copied from interface: CostEstimate
Get a copy of this CostEstimate

Specified by:
cloneMe in interface CostEstimate
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 interface CostEstimate
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 interface StoreCostResult
See Also:
StoreCostResult.getEstimatedCost()

setEstimatedCost

public void setEstimatedCost(double cost)
Description copied from interface: StoreCostResult
Set the estimated cost.

Specified by:
setEstimatedCost in interface StoreCostResult
See Also:
StoreCostResult.setEstimatedCost(double)

getEstimatedRowCount

public long getEstimatedRowCount()
Description copied from interface: StoreCostResult
Get the estimated row count.

Specified by:
getEstimatedRowCount in interface StoreCostResult
See Also:
StoreCostResult.getEstimatedRowCount()

setEstimatedRowCount

public void setEstimatedRowCount(long count)
Description copied from interface: StoreCostResult
Set the estimated row count.

Specified by:
setEstimatedRowCount in interface StoreCostResult
See Also:
StoreCostResult.setEstimatedRowCount(long)

setState

public CostEstimateImpl setState(double theCost,
                                 double theRowCount,
                                 CostEstimateImpl retval)

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.