Package jahuwaldt.js.datareader
Class UnitParameter<Q extends javax.measure.quantity.Quantity,E extends UnitParameter>
- java.lang.Object
-
- jahuwaldt.js.datareader.DataParam
-
- jahuwaldt.js.datareader.UnitParameter<Q,E>
-
- Type Parameters:
Q
- The unit Quantity type.E
- The unit parameter sub-type.
- All Implemented Interfaces:
DataElement
,java.lang.Comparable<DataElement>
,javolution.lang.Immutable
,javolution.lang.ValueType
- Direct Known Subclasses:
ArrayParam
,ScalarParam
public abstract class UnitParameter<Q extends javax.measure.quantity.Quantity,E extends UnitParameter> extends DataParam implements javolution.lang.ValueType
A class that represents a parameter in a case that has units associated with it.Modified by: Joseph A. Huwaldt
- Version:
- March 18, 2017
- Author:
- Joseph A. Huwaldt, Date: March 5, 2003
-
-
Field Summary
-
Fields inherited from interface jahuwaldt.js.datareader.DataElement
RESOURCES
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <R extends javax.measure.quantity.Quantity>
EchangeTo(javax.measure.unit.Unit<R> unit)
Returns the parameter that has the same values as this parameter but with the units changed (without converting the values).boolean
equals(java.lang.Object obj)
Compares the specified object with this parameter for strict equality same value, same units, same name, same user data.javax.measure.unit.Unit<Q>
getUnit()
Returns the unit in which the value is stated.int
hashCode()
Returns the hash code for thisUnitParameter
.abstract E
to(javax.measure.unit.Unit<Q> unit)
Returns the parameter equivalent to this parameter but stated in the specified unit.-
Methods inherited from class jahuwaldt.js.datareader.DataParam
compareTo, getName, getUserObject, setName, setUserObject, toString, toText
-
-
-
-
Method Detail
-
getUnit
public javax.measure.unit.Unit<Q> getUnit()
Returns the unit in which the value is stated.- Returns:
- the parameter unit.
-
to
public abstract E to(javax.measure.unit.Unit<Q> unit) throws javax.measure.converter.ConversionException
Returns the parameter equivalent to this parameter but stated in the specified unit.- Parameters:
unit
- the unit of the parameter to be returned.- Returns:
- a parameter equivalent to this parameter but stated in the specified unit.
- Throws:
javax.measure.converter.ConversionException
- if the current model does not allows for conversion to the specified unit.
-
changeTo
public abstract <R extends javax.measure.quantity.Quantity> E changeTo(javax.measure.unit.Unit<R> unit) throws javax.measure.converter.ConversionException
Returns the parameter that has the same values as this parameter but with the units changed (without converting the values).- Type Parameters:
R
- The unit of measure type (or Quantity) for the input units.- Parameters:
unit
- the unit of the parameter to be returned.- Returns:
- a parameter equivalent to this parameter but stated in the specified unit.
- Throws:
javax.measure.converter.ConversionException
- if the current model does not allows for conversion to the specified unit.
-
equals
public boolean equals(java.lang.Object obj)
Compares the specified object with this parameter for strict equality same value, same units, same name, same user data.
-
-