Beispiel #1
0
 /**
  * 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.
  *
  * @return the mutable datetime being used, so calls can be chained
  * @see DateTimeField#roundHalfEven
  */
 public MutableDateTime roundHalfEven() {
   iInstant.setMillis(getField().roundHalfEven(iInstant.getMillis()));
   return iInstant;
 }
Beispiel #2
0
 /**
  * Round to the highest whole unit of this field.
  *
  * @return the mutable datetime being used, so calls can be chained
  * @see DateTimeField#roundCeiling
  */
 public MutableDateTime roundCeiling() {
   iInstant.setMillis(getField().roundCeiling(iInstant.getMillis()));
   return iInstant;
 }
Beispiel #3
0
 /**
  * Sets a text value.
  *
  * @param text the text value to set
  * @param locale optional locale to use for selecting a text symbol
  * @return the mutable datetime being used, so calls can be chained
  * @throws IllegalArgumentException if the text value isn't valid
  * @see DateTimeField#set(long,java.lang.String,java.util.Locale)
  */
 public MutableDateTime set(String text, Locale locale) {
   iInstant.setMillis(getField().set(iInstant.getMillis(), text, locale));
   return iInstant;
 }
Beispiel #4
0
 /**
  * Sets a value.
  *
  * @param value the value to set.
  * @return the mutable datetime being used, so calls can be chained
  * @see DateTimeField#set(long,int)
  */
 public MutableDateTime set(int value) {
   iInstant.setMillis(getField().set(iInstant.getMillis(), value));
   return iInstant;
 }
Beispiel #5
0
 /**
  * Adds a value to the millis value.
  *
  * @param value the value to add
  * @return the mutable datetime being used, so calls can be chained
  * @see DateTimeField#add(long,long)
  */
 public MutableDateTime add(long value) {
   iInstant.setMillis(getField().add(iInstant.getMillis(), value));
   return iInstant;
 }
Beispiel #6
0
 /**
  * Gets the milliseconds of the datetime that this property is linked to.
  *
  * @return the milliseconds
  */
 protected long getMillis() {
   return iInstant.getMillis();
 }