Package org.intermine.objectstore.query
Class ResultsInfo
- java.lang.Object
-
- org.intermine.objectstore.query.ResultsInfo
-
public class ResultsInfo extends java.lang.ObjectRepresents a result from the estimate() method of an ObjectStore.- Author:
- Matthew Wakeling
-
-
Field Summary
Fields Modifier and Type Field Description static intAT_LEASTDenotes that the known number of rows has a minimum which exceed the estimate.static intAT_MOSTDenotes that the known number of rows has a maximum, and the estimate exceeds it.protected longcompletestatic intESTIMATEDenotes that the result of getRows() is a pure estimate that is not contradicted by the min or maxprotected intmaxprotected intminprotected introwsstatic intSIZEDenotes that the result of getRows() is the known size of the results.protected longstart
-
Constructor Summary
Constructors Constructor Description ResultsInfo()No-arg constructor to allow serializationResultsInfo(long start, long complete, int rows)Constructs an instance of ResultsInfo with all new parameters, without min and max.ResultsInfo(long start, long complete, int rows, int min, int max)Constructs an instance of ResultsInfo with all new parameters.ResultsInfo(ResultsInfo old, int min, int max)Constructs an instance of ResultsInfo from another ResultsInfo and a new min and max.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)longgetComplete()Returns the estimated amount of time taken to produce the entire set of results.intgetMax()Returns the maximum possible number of rows in the results.intgetMin()Returns the minimum possible number of rows in the results.intgetRows()Returns the estimated number of rows in the results.longgetStart()Returns the estimated amount of time taken to produce the first row of the results.intgetStatus()Returns an integer describing the type of estimate getRows() returns.inthashCode()voidsetComplete(long complete)Sets the estimated amount of time taken to produce the entire set of results.voidsetMax(int max)Sets the maximum possible number of rows in the results.voidsetMin(int min)Sets the minimum possible number of rows in the results.voidsetRows(int rows)Sets the estimated number of rows in the results.voidsetStart(long start)Sets the estimated amount of time taken to produce the first row of the results.java.lang.StringtoString()
-
-
-
Field Detail
-
start
protected long start
-
complete
protected long complete
-
min
protected int min
-
rows
protected int rows
-
max
protected int max
-
SIZE
public static final int SIZE
Denotes that the result of getRows() is the known size of the results.- See Also:
- Constant Field Values
-
AT_MOST
public static final int AT_MOST
Denotes that the known number of rows has a maximum, and the estimate exceeds it.- See Also:
- Constant Field Values
-
AT_LEAST
public static final int AT_LEAST
Denotes that the known number of rows has a minimum which exceed the estimate.- See Also:
- Constant Field Values
-
ESTIMATE
public static final int ESTIMATE
Denotes that the result of getRows() is a pure estimate that is not contradicted by the min or max- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResultsInfo
public ResultsInfo()
No-arg constructor to allow serialization
-
ResultsInfo
public ResultsInfo(long start, long complete, int rows)Constructs an instance of ResultsInfo with all new parameters, without min and max.- Parameters:
start- the estimated amount of time required to fetch the first row of results, in millisecondscomplete- the estimated amount of time required to fetch the full set of results, in millisecondsrows- the best current estimate of the number of rows that the results contains, neglecting information available about the minimum possible and maximum possible number
-
ResultsInfo
public ResultsInfo(long start, long complete, int rows, int min, int max)Constructs an instance of ResultsInfo with all new parameters.- Parameters:
start- the estimated amount of time required to fetch the first row of results, in millisecondscomplete- the estimated amount of time required to fetch the full set of results, in millisecondsrows- the best current estimate of the number of rows that the results contains, neglecting information available about the minimum possible and maximum possible numbermin- the minimum possible number of rowsmax- the maximum possible number of rows
-
ResultsInfo
public ResultsInfo(ResultsInfo old, int min, int max)
Constructs an instance of ResultsInfo from another ResultsInfo and a new min and max.- Parameters:
old- the old ResultsInfo object from which to copy datamin- the minimum possible number of rowsmax- the maximum possible number of rows
-
-
Method Detail
-
getStatus
public int getStatus()
Returns an integer describing the type of estimate getRows() returns.- Returns:
- SIZE, ESTIMATE, AT_MOST, AT_LEAST
-
getRows
public int getRows()
Returns the estimated number of rows in the results.- Returns:
- an int
-
setRows
public void setRows(int rows)
Sets the estimated number of rows in the results. NOTE: this method is only present to make this class a Bean.- Parameters:
rows- the new rows variable
-
getStart
public long getStart()
Returns the estimated amount of time taken to produce the first row of the results.- Returns:
- a long of milliseconds
-
setStart
public void setStart(long start)
Sets the estimated amount of time taken to produce the first row of the results. NOTE: this method is only present to make this class a Bean.- Parameters:
start- a long
-
getComplete
public long getComplete()
Returns the estimated amount of time taken to produce the entire set of results.- Returns:
- a long of milliseconds
-
setComplete
public void setComplete(long complete)
Sets the estimated amount of time taken to produce the entire set of results. NOTE: this method is only present to make this class a Bean.- Parameters:
complete- a long
-
getMin
public int getMin()
Returns the minimum possible number of rows in the results.- Returns:
- an int
-
setMin
public void setMin(int min)
Sets the minimum possible number of rows in the results. NOTE: this method is only present to make this class a Bean.- Parameters:
min- an int
-
getMax
public int getMax()
Returns the maximum possible number of rows in the results.- Returns:
- an int
-
setMax
public void setMax(int max)
Sets the maximum possible number of rows in the results. NOTE: this method is only present to make this class a Bean.- Parameters:
max- an int
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-