public abstract class ValueFormatter extends Object
ICounter
values (not thread-safe since
the Format
objects are not thread-safe).Modifier and Type | Field and Description |
---|---|
protected Format |
dateFormat
Used to format date/time values.
|
protected DecimalFormat |
decimalFormat
Used to format double and float counter values.
|
protected NumberFormat |
integerFormat
Used to format integer and long counter values.
|
protected static Pattern |
percent_pattern
A pattern matching the occurrence of the word "percent" in a counter
name.
|
protected NumberFormat |
percentFormat
Used to format counter values that can be inferred to be a percentage.
|
protected DecimalFormat |
unitsFormat
Used to format the units of time when expressed as elapsed units since
the first sample of a
History . |
Constructor and Description |
---|
ValueFormatter(URLQueryModel model) |
Modifier and Type | Method and Description |
---|---|
String |
date(long timestamp)
Format a timestamp as a date.
|
abstract String |
value(ICounter counter,
Object val)
Formats a counter value as a String.
|
abstract void |
writeFullPath(Writer w,
String path)
Write the full counter path.
|
abstract void |
writePath(Writer w,
String path,
int rootDepth)
Write a partial counter path.
|
protected final DecimalFormat decimalFormat
protected final NumberFormat percentFormat
protected final NumberFormat integerFormat
protected final DecimalFormat unitsFormat
History
.protected final Format dateFormat
protected static final Pattern percent_pattern
public ValueFormatter(URLQueryModel model)
public abstract String value(ICounter counter, Object val)
counter
- The counter.value
- The counter value (MAY be null
).public abstract void writeFullPath(Writer w, String path) throws IOException
IOException
public abstract void writePath(Writer w, String path, int rootDepth) throws IOException
rootDepth
- The path components will be shown beginning at this depth -
ZERO (0) is the root.IOException
public String date(long timestamp)
timestamp
- The timestamp value.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.