Package tech.units.indriya.quantity
Class DefaultQuantityFactory<Q extends javax.measure.Quantity<Q>>
java.lang.Object
tech.units.indriya.quantity.DefaultQuantityFactory<Q>
- Type Parameters:
Q
- The type of the quantity.
- All Implemented Interfaces:
javax.measure.spi.QuantityFactory<Q>
public class DefaultQuantityFactory<Q extends javax.measure.Quantity<Q>>
extends Object
implements javax.measure.spi.QuantityFactory<Q>
A factory producing simple quantities instances (tuples
For example:
Number
/ Unit
).For example:
Mass m = DefaultQuantityFactory.getInstance(Mass.class).create(23.0, KILOGRAM); // 23.0 kg
Time m = DefaultQuantityFactory.getInstance(Time.class).create(124, MILLI(SECOND)); // 124 ms
- Since:
- 1.0
- Version:
- 1.1, $Date: 2018-03-04 $
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
INSTANCES
-
logger
-
LOG_LEVEL
-
type
The type of the quantities created by this factory. -
metricUnit
The metric unit for quantities created by this factory. -
CLASS_TO_METRIC_UNIT
-
-
Constructor Details
-
DefaultQuantityFactory
-
-
Method Details
-
getInstance
public static <Q extends javax.measure.Quantity<Q>> javax.measure.spi.QuantityFactory<Q> getInstance(Class<Q> type) Returns the default instance for the specified quantity type.- Type Parameters:
Q
- The type of the quantity- Parameters:
type
- the quantity type- Returns:
- the quantity factory for the specified type
-
toString
-
equals
-
hashCode
public int hashCode() -
create
-
getSystemUnit
-