Package org.openjdk.jmc.common.unit
Class QuantityRange<U extends TypedUnit<U>>
java.lang.Object
org.openjdk.jmc.common.unit.QuantityRange<U>
- All Implemented Interfaces:
IDisplayable,IRange<IQuantity>
public abstract class QuantityRange<U extends TypedUnit<U>>
extends Object
implements IRange<IQuantity>
A finite range of quantities.
-
Field Summary
FieldsFields inherited from interface org.openjdk.jmc.common.IDisplayable
AUTO, EXACT, VERBOSE -
Method Summary
Modifier and TypeMethodDescriptionstatic IDisplayablecreateInfinite(IQuantity start, IQuantity end) createPoint(IQuantity start) createWithEnd(IQuantity start, IQuantity end) createWithExtent(IQuantity start, ITypedQuantity<LinearUnit> extent) displayUsing(String formatHint) Format this object for display purposes, preferably using the formatter hinted byformatHint.abstract ITypedQuantity<U>getEnd()getStart()intersection(IRange<IQuantity> a, IRange<IQuantity> b)
-
Field Details
-
start
-
-
Method Details
-
createPoint
-
createWithEnd
-
createWithExtent
public static <U extends TypedUnit<U>> IRange<IQuantity> createWithExtent(IQuantity start, ITypedQuantity<LinearUnit> extent) -
createInfinite
Create anIRange<IQuantity>ifstartandendboth are non-null. Otherwise, create anIDisplayablethat looks like an infinite range, by treating null values as minus or plus infinity, respectively. This behavior is a consequence of the current state whereIQuantityand thuslyIRange<IQuantity>both need to be finite. (A possible change to this state, when all kinds of quantities support being stored as doubles, is to allowDouble.NEGATIVE_INFINITYandDouble.POSITIVE_INFINITYas numerical quantities. In that case, this method can be replaced withcreateWithEnd(IQuantity, IQuantity)). -
intersection
-
union
-
getStart
-
getEnd
-
displayUsing
Description copied from interface:IDisplayableFormat this object for display purposes, preferably using the formatter hinted byformatHint. If no such formatter is defined for this type, the default formatter will be used.- Specified by:
displayUsingin interfaceIDisplayable- Parameters:
formatHint- the format hint- Returns:
- a formatted string according to the hinted (or default) formatter
-