public interface QuantityOperator<Q extends javax.measure.Quantity<Q>>
Quantity
that produces a
result of type Quantity
.
Examples might be an operator that rounds the amount to the nearest 1000, or one that performs other quantity operations.
// Example result = thisOperator.apply(quantity);
Quantity
to
determine the result.
The input object must not be altered. Instead, an altered copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable quantities.
This method may be called from multiple threads in parallel. It must be thread-safe when invoked.
This interface is modeled after java.util.function.UnaryOperator
in Java SE 8,
but intended to be Java ME compatible as well.
Modifier and Type | Method and Description |
---|---|
javax.measure.Quantity<Q> |
apply(javax.measure.Quantity<Q> quantity)
Applies the operator on the given quantity.
|
Copyright © 2005–2018 Units of Measurement project. All rights reserved.