org.goda.time
public abstract class Field extends Object
| Constructor and Description |
|---|
Field() |
| Modifier and Type | Method and Description |
|---|---|
abstract long |
add(long instant,
int value)
Adds a value (which may be negative) to the instant.
|
abstract long |
add(long instant,
long value)
Adds a value (which may be negative) to the instant.
|
abstract int |
getDifference(long minuendInstant,
long subtrahendInstant)
Computes the difference between two instants, as measured in the units
of this field.
|
abstract long |
getDifferenceAsLong(long minuendInstant,
long subtrahendInstant)
Computes the difference between two instants, as measured in the units
of this field.
|
abstract String |
getName()
Get the name of the field.
|
abstract boolean |
isSupported()
Returns true if this field is supported.
|
abstract String |
toString()
Get a suitable debug string.
|
public abstract String getName()
By convention, names are plural.
public abstract boolean isSupported()
public abstract int getDifference(long minuendInstant,
long subtrahendInstant)
long instant = ... int v = ... int age = getDifference(add(instant, v), instant);The value 'age' is the same as the value 'v'.
minuendInstant - the milliseconds from 1970-01-01T00:00:00Z to
subtract fromsubtrahendInstant - the milliseconds from 1970-01-01T00:00:00Z to
subtract off the minuendpublic abstract long getDifferenceAsLong(long minuendInstant,
long subtrahendInstant)
long instant = ... long v = ... long age = getDifferenceAsLong(add(instant, v), instant);The value 'age' is the same as the value 'v'.
minuendInstant - the milliseconds from 1970-01-01T00:00:00Z to
subtract fromsubtrahendInstant - the milliseconds from 1970-01-01T00:00:00Z to
subtract off the minuendpublic abstract long add(long instant,
int value)
instant - the milliseconds from 1970-01-01T00:00:00Z to add tovalue - the value to add, in the units of the fieldpublic abstract long add(long instant,
long value)
instant - the milliseconds from 1970-01-01T00:00:00Z to add tovalue - the value to add, in the units of the fieldCopyright © 2013 os-cillation GmbH. All rights reserved.