/** * Gets the amount by which this field is leap. * * @return the amount by which the field is leap * @see DateTimeField#getLeapAmount */ public int getLeapAmount() { return getField().getLeapAmount(getMillis()); }
/** * Gets whether this field is leap. * * @return true if a leap field * @see DateTimeField#isLeap */ public boolean isLeap() { return getField().isLeap(getMillis()); }
/** * Gets the minimum value for the field. * * @return the minimum value * @see DateTimeField#getMinimumValue */ public int getMinimumValue() { return getField().getMinimumValue(getMillis()); }
/** * Gets the maximum value for the field. * * @return the maximum value * @see DateTimeField#getMaximumValue */ public int getMaximumValue() { return getField().getMaximumValue(getMillis()); }
/** * Returns the fractional duration milliseconds of this field. * * @see DateTimeField#remainder * @return remainder duration, in milliseconds */ public long remainder() { return getField().remainder(getMillis()); }
/** * Gets whether this field is leap. * * @return true if a leap field * @see DateTimeField#isLeap */ public boolean isLeap() { return getField().isLeap(getMillis()); }
/** * Returns the fractional duration milliseconds of this field. * * @see DateTimeField#remainder * @return remainder duration, in milliseconds */ public long remainder() { return getField().remainder(getMillis()); }
/** * Gets the minimum value for the field. * * @return the minimum value * @see DateTimeField#getMinimumValue */ public int getMinimumValue() { return getField().getMinimumValue(getMillis()); }
/** * Gets the maximum value for the field. * * @return the maximum value * @see DateTimeField#getMaximumValue */ public int getMaximumValue() { return getField().getMaximumValue(getMillis()); }
/** * Gets the amount by which this field is leap. * * @return the amount by which the field is leap * @see DateTimeField#getLeapAmount */ public int getLeapAmount() { return getField().getLeapAmount(getMillis()); }
/** * Gets the textual value of this property from the instant as a * string in the specified locale. * <p> * This method returns the value converted to a <code>String</code> * returning the appropriate textual description wherever possible. * Thus, a day of week of 1 would return 'Monday' in English. * * @param locale locale to use for selecting a text symbol, null means default * @return the current text value * @see DateTimeField#getAsText */ public String getAsText(Locale locale) { return getField().getAsText(getMillis(), locale); }
/** * Gets the short textual value of this property from the instant as a * string in the specified locale. * <p> * This method returns the value converted to a <code>String</code> * returning the appropriate textual description wherever possible. * Thus, a day of week of 1 would return 'Mon' in English. * * @param locale locale to use for selecting a text symbol, null means default * @return the current text value * @see DateTimeField#getAsShortText */ public String getAsShortText(Locale locale) { return getField().getAsShortText(getMillis(), locale); }
/** * Gets the value of this property from the instant. * <p> * For example, the following two lines of code are equivalent: * <pre> * datetime.getDayOfMonth(); * datetime.dayOfMonth().get(); * </pre> * * @return the current value * @see DateTimeField#get */ public int get() { return getField().get(getMillis()); }
/** * Gets the value of this property from the instant. * <p> * For example, the following two lines of code are equivalent: * <pre> * datetime.getDayOfMonth(); * datetime.dayOfMonth().get(); * </pre> * * @return the current value * @see DateTimeField#get */ public int get() { return getField().get(getMillis()); }
/** * Gets the short textual value of this property from the instant as a * string in the specified locale. * <p> * This method returns the value converted to a <code>String</code> * returning the appropriate textual description wherever possible. * Thus, a day of week of 1 would return 'Mon' in English. * * @param locale locale to use for selecting a text symbol, null means default * @return the current text value * @see DateTimeField#getAsShortText */ public String getAsShortText(Locale locale) { return getField().getAsShortText(getMillis(), locale); }
/** * Gets the textual value of this property from the instant as a * string in the specified locale. * <p> * This method returns the value converted to a <code>String</code> * returning the appropriate textual description wherever possible. * Thus, a day of week of 1 would return 'Monday' in English. * * @param locale locale to use for selecting a text symbol, null means default * @return the current text value * @see DateTimeField#getAsText */ public String getAsText(Locale locale) { return getField().getAsText(getMillis(), locale); }
/** * Returns the difference between this field property instant and the one * passed in, in the units of this field. The sign of the difference * matches that of compareTo. In other words, this field property's instant * is the minuend. * * @param instant the subtrahend, null means now * @return the difference in the units of this field * @see DateTimeField#getDifference */ public int getDifference(ReadableInstant instant) { if (instant == null) { return getField().getDifference(getMillis(), DateTimeUtils.currentTimeMillis()); } return getField().getDifference(getMillis(), instant.getMillis()); }
/** * Returns the difference between this field property instant and the one * passed in, in the units of this field. The sign of the difference * matches that of compareTo. In other words, this field property's instant * is the minuend. * * @param instant the subtrahend, null means now * @return the difference in the units of this field * @see DateTimeField#getDifference */ public long getDifferenceAsLong(ReadableInstant instant) { if (instant == null) { return getField().getDifferenceAsLong(getMillis(), DateTimeUtils.currentTimeMillis()); } return getField().getDifferenceAsLong(getMillis(), instant.getMillis()); }
/** * Returns the difference between this field property instant and the one * passed in, in the units of this field. The sign of the difference * matches that of compareTo. In other words, this field property's instant * is the minuend. * * @param instant the subtrahend, null means now * @return the difference in the units of this field * @see DateTimeField#getDifference */ public int getDifference(ReadableInstant instant) { if (instant == null) { return getField().getDifference(getMillis(), DateTimeUtils.currentTimeMillis()); } return getField().getDifference(getMillis(), instant.getMillis()); }
/** * Returns the interval that represents the range of the minimum * and maximum values of this field. * <p> * For example, <code>datetime.monthOfYear().toInterval()</code> * will return an interval over the whole month. * * @return the interval of this field * @since 1.2 */ public Interval toInterval() { DateTimeField field = getField(); long start = field.roundFloor(getMillis()); long end = field.add(start, 1); Interval interval = new Interval(start, end, getChronology()); return interval; }