Class ResultsInfo


  • public class ResultsInfo
    extends java.lang.Object
    Represents a result from the estimate() method of an ObjectStore.
    Author:
    Matthew Wakeling
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int AT_LEAST
      Denotes that the known number of rows has a minimum which exceed the estimate.
      static int AT_MOST
      Denotes that the known number of rows has a maximum, and the estimate exceeds it.
      protected long complete  
      static int ESTIMATE
      Denotes that the result of getRows() is a pure estimate that is not contradicted by the min or max
      protected int max  
      protected int min  
      protected int rows  
      static int SIZE
      Denotes that the result of getRows() is the known size of the results.
      protected long start  
    • Constructor Summary

      Constructors 
      Constructor Description
      ResultsInfo()
      No-arg constructor to allow serialization
      ResultsInfo​(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
      boolean equals​(java.lang.Object o)
      long getComplete()
      Returns the estimated amount of time taken to produce the entire set of results.
      int getMax()
      Returns the maximum possible number of rows in the results.
      int getMin()
      Returns the minimum possible number of rows in the results.
      int getRows()
      Returns the estimated number of rows in the results.
      long getStart()
      Returns the estimated amount of time taken to produce the first row of the results.
      int getStatus()
      Returns an integer describing the type of estimate getRows() returns.
      int hashCode()
      void setComplete​(long complete)
      Sets the estimated amount of time taken to produce the entire set of results.
      void setMax​(int max)
      Sets the maximum possible number of rows in the results.
      void setMin​(int min)
      Sets the minimum possible number of rows in the results.
      void setRows​(int rows)
      Sets the estimated number of rows in the results.
      void setStart​(long start)
      Sets the estimated amount of time taken to produce the first row of the results.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 milliseconds
        complete - the estimated amount of time required to fetch the full set of results, in milliseconds
        rows - 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 milliseconds
        complete - the estimated amount of time required to fetch the full set of results, in milliseconds
        rows - the best current estimate of the number of rows that the results contains, neglecting information available about the minimum possible and maximum possible number
        min - the minimum possible number of rows
        max - 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 data
        min - the minimum possible number of rows
        max - 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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object