Class IntSeries

java.lang.Object
com.frostwire.jlibtorrent.IntSeries

public final class IntSeries extends Object
This is a limited capability data point series backed by a circular buffer logic. Used to hold equally timed sample of statistics.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    get(int index)
    This method will always returns a value, but keep in mind that due to the nature of the circular buffer internal logic, if you pass past the size, you will get the sames values again.
    long
    This method will always returns a value, if the series is empty 0 is returned.
    int
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • get

      public long get(int index)
      This method will always returns a value, but keep in mind that due to the nature of the circular buffer internal logic, if you pass past the size, you will get the sames values again. Use size() for a proper boundary check.

      Usage example:

       
           for (int i = min(series.size(), desired_count); i >= 0; i--) {
               plotMyValueAt(i, series.get(i));
           }
       
       
      Parameters:
      index - the value's index
      Returns:
      the value in the series
    • last

      public long last()
      This method will always returns a value, if the series is empty 0 is returned.
      Returns:
      the last value in the series
    • size

      public int size()
    • toString

      public String toString()
      Overrides:
      toString in class Object