Interface Sample

All Known Subinterfaces:
Sample.Derived, Sample.Labeled
All Known Implementing Classes:
LabeledSample

public interface Sample
Common behavior to all types of samples.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Sample that does not exist as an actual observation but is derived from actual observations.
    static interface 
    A sample with a label and a timestamp, typically representing actual observations (rather than derived values).
  • Method Summary

    Modifier and Type
    Method
    Description
    derived(double value)
    Create a new derived value without a reference.
    derived(double value, Sample.Labeled reference)
    Create a new derived value with a reference.
    double
    Returns the value as a double.
    labeled(double value)
    Create a labeled value.
  • Method Details

    • derived

      static Sample.Derived derived(double value, Sample.Labeled reference)
      Create a new derived value with a reference.
      Parameters:
      value - value
      reference - reference
      Returns:
      a new derived value
    • derived

      static Sample.Derived derived(double value)
      Create a new derived value without a reference.
      Parameters:
      value - value
      Returns:
      a new derived value
    • labeled

      static Sample.Labeled labeled(double value)
      Create a labeled value.
      Parameters:
      value - value
      Returns:
      a new labeled value if exemplar handling is supported
    • doubleValue

      double doubleValue()
      Returns the value as a double.

      For actual samples this serves as a conversion from long to double so all sample types can be treated somewhat uniformly.

      Returns:
      value of the sample as a double