Package tech.units.indriya.spi
Class AbstractMeasurement<Q extends javax.measure.Quantity<Q>>
java.lang.Object
tech.units.indriya.spi.AbstractMeasurement<Q>
- All Implemented Interfaces:
Serializable
,Comparable<Measurement<Q>>
,Measurement<Q>
,tech.uom.lib.common.function.QuantitySupplier<Q>
- Direct Known Subclasses:
AbstractMeasurement.Default
,AbstractMeasurement.DefaultComparable
abstract class AbstractMeasurement<Q extends javax.measure.Quantity<Q>>
extends Object
implements Measurement<Q>, Comparable<Measurement<Q>>
This class represents the immutable result of a measurement stated in a known quantity.
All instances of this class shall be immutable.
- Version:
- 0.4 $Date: 2016-10-15 $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
AbstractMeasurement.Default<Q extends javax.measure.Quantity<Q>>
This class represents the default measurement.(package private) static final class
AbstractMeasurement.DefaultComparable<Q extends javax.measure.Quantity<Q>>
This class represents the default measurement. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractMeasurement
(javax.measure.Quantity<Q> q) constructor.protected
AbstractMeasurement
(javax.measure.Quantity<Q> q, long t) constructor.protected
AbstractMeasurement
(javax.measure.Quantity<Q> q, Instant i) constructor. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
quantity
-
instant
-
-
Constructor Details
-
AbstractMeasurement
constructor. -
AbstractMeasurement
constructor. -
AbstractMeasurement
constructor.
-
-
Method Details
-
getQuantity
Returns the measurement quantity. -
getInstant
Returns the measurement instant.- Specified by:
getInstant
in interfaceMeasurement<Q extends javax.measure.Quantity<Q>>
- Returns:
- the instant.
-
getTimestamp
public final long getTimestamp()Returns the measurement timestamp.- Specified by:
getTimestamp
in interfaceMeasurement<Q extends javax.measure.Quantity<Q>>
- Returns:
- the timestamp.
-
equals
-
hashCode
public int hashCode() -
toString
-