public static class Rounding.OffsetRounding extends Rounding
Rounding.FactorRounding, Rounding.Interval, Rounding.OffsetRounding, Rounding.Streams
Modifier and Type | Field and Description |
---|---|
static ParseField |
OFFSET_FIELD |
Constructor and Description |
---|
OffsetRounding(Rounding intervalRounding,
long offset) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
byte |
id() |
long |
nextRoundingValue(long value)
Given the rounded value (which was potentially generated by
Rounding.round(long) , returns the next rounding value. |
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
long |
round(long value)
Rounds the given value.
|
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
public static final ParseField OFFSET_FIELD
public OffsetRounding(Rounding intervalRounding, long offset)
public long round(long value)
Rounding
public long nextRoundingValue(long value)
Rounding
Rounding.round(long)
, returns the next rounding value. For example, with
interval based rounding, if the interval is 3, nextRoundValue(6) = 9
.nextRoundingValue
in class Rounding
value
- The current rounding valuepublic void readFrom(StreamInput in) throws java.io.IOException
Streamable
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
java.io.IOException