- 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
Modifier and TypeInterfaceDescriptionstatic 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 TypeMethodDescriptionstatic Sample.Derived
derived
(double value) Create a new derived value without a reference.static Sample.Derived
derived
(double value, Sample.Labeled reference) Create a new derived value with a reference.double
Returns the value as a double.static Sample.Labeled
labeled
(double value) Create a labeled value.
-
Method Details
-
derived
Create a new derived value with a reference.- Parameters:
value
- valuereference
- reference- Returns:
- a new derived value
-
derived
Create a new derived value without a reference.- Parameters:
value
- value- Returns:
- a new derived value
-
labeled
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
-