Class Exemplars

Object
Exemplars
All Implemented Interfaces:
Iterable<Exemplar>

public class Exemplars extends Object implements Iterable<Exemplar>
Immutable container for Exemplars.

This is currently backed by a List<Exemplar>. May be refactored later to use a more efficient data structure.

  • Field Details

    • EMPTY

      public static final Exemplars EMPTY
      EMPTY means no Exemplars.
  • Method Details

    • of

      public static Exemplars of(Collection<Exemplar> exemplars)
      Create a new Exemplars instance. You can either create Exemplars with one of the static Exemplars.of(...) methods, or you can use the builder().
      Parameters:
      exemplars - a copy of the exemplars collection will be created.
    • of

      public static Exemplars of(Exemplar... exemplars)
      Create a new Exemplars instance. You can either create Exemplars with one of the static Exemplars.of(...) methods, or you can use the builder().
      Parameters:
      exemplars - a copy of the exemplars array will be created.
    • iterator

      Specified by:
      iterator in interface Iterable<Exemplar>
    • size

      public int size()
    • get

      public Exemplar get(int index)
    • get

      public Exemplar get(double lowerBound, double upperBound)
      This is used by classic histograms to find an exemplar with a value between lowerBound and upperBound. If there is more than one exemplar within the bounds the one with the newest time stamp is returned.
    • getLatest

      public Exemplar getLatest()
      Find the Exemplar with the newest timestamp. May return null.
    • builder

      public static Exemplars.Builder builder()