public abstract class Rounding extends java.lang.Object implements Streamable
Modifier and Type | Class and Description |
---|---|
static class |
Rounding.Builder |
static class |
Rounding.Streams |
Constructor and Description |
---|
Rounding() |
Modifier and Type | Method and Description |
---|---|
static Rounding.Builder |
builder(DateTimeUnit unit) |
static Rounding.Builder |
builder(TimeValue interval) |
abstract boolean |
equals(java.lang.Object obj) |
abstract int |
hashCode() |
abstract byte |
id() |
abstract long |
nextRoundingValue(long value)
Given the rounded value (which was potentially generated by
round(long) , returns the next rounding value. |
abstract long |
round(long value)
Rounds the given value.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
readFrom, writeTo
public abstract byte id()
public abstract long round(long value)
public abstract long nextRoundingValue(long value)
round(long)
, returns the next rounding value. For example, with
interval based rounding, if the interval is 3, nextRoundValue(6) = 9
.value
- The current rounding valuepublic abstract boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public abstract int hashCode()
hashCode
in class java.lang.Object
public static Rounding.Builder builder(DateTimeUnit unit)
public static Rounding.Builder builder(TimeValue interval)