Package org.openjdk.jmc.common.unit
Interface IIncrementalFormatter
-
- All Superinterfaces:
IFormatter<IQuantity>
public interface IIncrementalFormatter extends IFormatter<IQuantity>
Quantity formatter extension to reduce redundant information when presenting multiple adjacent, and growing, quantities for human consumption.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
formatAdjacent(IQuantity previous, IQuantity current)
Return a string representation ofcurrent
that is minimalistic, yet includes sufficient context so that a human can deduce its full value, given that a sufficient representation ofprevious
is presented immediately ahead.String
formatContext(IQuantity firstPresented)
Return a string context that can be presented ahead of presentingfirstPresented
so that the latter can be presented with a minimalistic representation usingformatChange(firstPresented, firstPresented)
.-
Methods inherited from interface org.openjdk.jmc.common.unit.IFormatter
format
-
-
-
-
Method Detail
-
formatContext
String formatContext(IQuantity firstPresented)
Return a string context that can be presented ahead of presentingfirstPresented
so that the latter can be presented with a minimalistic representation usingformatChange(firstPresented, firstPresented)
.
-
formatAdjacent
String formatAdjacent(IQuantity previous, IQuantity current)
Return a string representation ofcurrent
that is minimalistic, yet includes sufficient context so that a human can deduce its full value, given that a sufficient representation ofprevious
is presented immediately ahead.- Parameters:
previous
- the immediately preceding presented quantity, ornull
to force a fully qualified representationcurrent
- the quantity to format- Returns:
- a minimalistic context sensitive representation
-
-