Joda Time API

org.joda.time
Class MutableDateTimeFieldProperty

java.lang.Object
  |
  +--org.joda.time.DateTimeFieldProperty
        |
        +--org.joda.time.MutableDateTimeFieldProperty
All Implemented Interfaces:
java.io.Serializable

public class MutableDateTimeFieldProperty
extends DateTimeFieldProperty

MutableDateTimeFieldProperty binds a ReadWritableInstant to a DateTimeField.

MutableDateTimeFieldProperty allows the date and time manipulation code to be field based yet still easy to use.

Since:
1.0
Author:
Stephen Colebourne, Brian S O'Neill
See Also:
ReadWritableInstant, DateTimeField, Serialized Form

Constructor Summary
MutableDateTimeFieldProperty(ReadWritableInstant instant, DateTimeField field)
          Constructor.
 
Method Summary
 void add(int value)
          Adds a value to the millis value.
 void add(long value)
          Adds a value to the millis value.
 void addWrapped(int value)
          Adds a value, possibly wrapped, to the millis value.
 void remainder()
          Retains only the fractional units of this field.
 void roundCeiling()
          Round to the highest whole unit of this field.
 void roundFloor()
          Round to the lowest whole unit of this field.
 void roundHalfCeiling()
          Round to the nearest whole unit of this field, favoring the ceiling if halfway.
 void roundHalfEven()
          Round to the nearest whole unit of this field.
 void roundHalfFloor()
          Round to the nearest whole unit of this field, favoring the floor if halfway.
 void set(int value)
          Sets a value.
 void set(java.lang.String text)
          Sets a text value.
 void set(java.lang.String text, java.util.Locale locale)
          Sets a text value.
 
Methods inherited from class org.joda.time.DateTimeFieldProperty
compareTo, get, getAsShortText, getAsShortText, getAsText, getAsText, getDifference, getField, getInstant, getLeapAmount, getMaximumShortTextLength, getMaximumTextLength, getMaximumValue, getMaximumValueOverall, getMinimumValue, getMinimumValueOverall, getName, getRangeMillis, getUnitMillis, isLeap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutableDateTimeFieldProperty

public MutableDateTimeFieldProperty(ReadWritableInstant instant,
                                    DateTimeField field)
Constructor.

Parameters:
instant - the instant to set
field - the field to use
Method Detail

add

public void add(int value)
Adds a value to the millis value.

Parameters:
value - the value to add.
See Also:
DateTimeField.add(long,int)

add

public void add(long value)
Adds a value to the millis value.

Parameters:
value - the value to add.
See Also:
DateTimeField.add(long,long)

addWrapped

public void addWrapped(int value)
Adds a value, possibly wrapped, to the millis value.

Parameters:
value - the value to add.
See Also:
DateTimeField.addWrapped(long, int)

set

public void set(int value)
Sets a value.

Parameters:
value - the value to set.
See Also:
DateTimeField.set(long,int)

set

public void set(java.lang.String text,
                java.util.Locale locale)
Sets a text value.

Parameters:
text - the text value to set
locale - optional locale to use for selecting a text symbol
Throws:
java.lang.IllegalArgumentException - if the text value isn't valid
See Also:
DateTimeField.set(long,java.lang.String,java.util.Locale)

set

public final void set(java.lang.String text)
Sets a text value.

Parameters:
text - the text value to set
Throws:
java.lang.IllegalArgumentException - if the text value isn't valid
See Also:
DateTimeField.set(long,java.lang.String)

roundFloor

public void roundFloor()
Round to the lowest whole unit of this field.

See Also:
DateTimeField.roundFloor(long)

roundCeiling

public void roundCeiling()
Round to the highest whole unit of this field.

See Also:
DateTimeField.roundCeiling(long)

roundHalfFloor

public void roundHalfFloor()
Round to the nearest whole unit of this field, favoring the floor if halfway.

See Also:
DateTimeField.roundHalfFloor(long)

roundHalfCeiling

public void roundHalfCeiling()
Round to the nearest whole unit of this field, favoring the ceiling if halfway.

See Also:
DateTimeField.roundHalfCeiling(long)

roundHalfEven

public void roundHalfEven()
Round to the nearest whole unit of this field. If halfway, the ceiling is favored the floor only if it makes this field's value even.

See Also:
DateTimeField.roundHalfEven(long)

remainder

public void remainder()
Retains only the fractional units of this field.

See Also:
DateTimeField.remainder(long)

Joda Time API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.