org.joda.time
Class MutableDateTime.Property
- MutableDateTime
- Serializable
public static final class MutableDateTime.Property
MutableDateTime.Property binds a MutableDateTime to a
DateTimeField allowing powerful datetime functionality to be easily
accessed.
The example below shows how to use the property to change the value of a
MutableDateTime object.
MutableDateTime dt = new MutableDateTime(1972, 12, 3, 13, 32, 19, 123);
dt.year().add(20);
dt.second().roundFloor().minute().set(10);
MutableDateTime.Propery itself is thread-safe and immutable, but the
MutableDateTime being operated on is not.
- Stephen Colebourne
- Brian S O'Neill
compareTo , compareTo , equals , get , getAsShortText , getAsShortText , getAsString , getAsText , getAsText , getChronology , getDifference , getDifferenceAsLong , getDurationField , getField , getFieldType , getLeapAmount , getLeapDurationField , getMaximumShortTextLength , getMaximumTextLength , getMaximumValue , getMaximumValueOverall , getMillis , getMinimumValue , getMinimumValueOverall , getName , getRangeDurationField , hashCode , isLeap , remainder , toInterval , toString |
add
public MutableDateTime add(int value)
Adds a value to the millis value.
- the mutable datetime being used, so calls can be chained
add
public MutableDateTime add(long value)
Adds a value to the millis value.
- the mutable datetime being used, so calls can be chained
addWrapField
public MutableDateTime addWrapField(int value)
Adds a value, possibly wrapped, to the millis value.
- the mutable datetime being used, so calls can be chained
DateTimeField.addWrapField
getMutableDateTime
public MutableDateTime getMutableDateTime()
Gets the mutable datetime being used.
roundCeiling
public MutableDateTime roundCeiling()
Round to the highest whole unit of this field.
- the mutable datetime being used, so calls can be chained
roundFloor
public MutableDateTime roundFloor()
Round to the lowest whole unit of this field.
- the mutable datetime being used, so calls can be chained
roundHalfCeiling
public MutableDateTime roundHalfCeiling()
Round to the nearest whole unit of this field, favoring the ceiling if
halfway.
- the mutable datetime being used, so calls can be chained
roundHalfEven
public MutableDateTime roundHalfEven()
Round to the nearest whole unit of this field. If halfway, the ceiling
is favored over the floor only if it makes this field's value even.
- the mutable datetime being used, so calls can be chained
roundHalfFloor
public MutableDateTime roundHalfFloor()
Round to the nearest whole unit of this field, favoring the floor if
halfway.
- the mutable datetime being used, so calls can be chained
set
public MutableDateTime set(String text)
Sets a text value.
text
- the text value to set
- the mutable datetime being used, so calls can be chained
DateTimeField.set(long,java.lang.String)
set
public MutableDateTime set(String text,
Locale locale)
Sets a text value.
text
- the text value to setlocale
- optional locale to use for selecting a text symbol
- the mutable datetime being used, so calls can be chained
DateTimeField.set(long,java.lang.String,java.util.Locale)
set
public MutableDateTime set(int value)
Sets a value.
value
- the value to set.
- the mutable datetime being used, so calls can be chained
Copyright (c) 2001-2006 - Joda.org