/** * Obtains the value of the MONTHS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the MONTHS field. * * @return Months of this <code>Duration</code>. */ public int getMonths() { return getFieldValueAsInt(DatatypeConstants.MONTHS); }
/** * Obtains the value of the DAYS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the DAYS field. * * @return Days of this <code>Duration</code>. */ public int getDays() { return getFieldValueAsInt(DatatypeConstants.DAYS); }
/** * Obtains the value of the MINUTES field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the MINUTES field. * * @return Minutes of this <code>Duration</code>. * */ public int getMinutes() { return getFieldValueAsInt(DatatypeConstants.MINUTES); }
/** * Obtains the value of the HOURS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the HOURS field. * * @return Hours of this <code>Duration</code>. * */ public int getHours() { return getFieldValueAsInt(DatatypeConstants.HOURS); }
/** * Obtains the value of the SECONDS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the SECONDS field. * * @return seconds in the integer value. The fraction of seconds * will be discarded (for example, if the actual value is 2.5, * this method returns 2) */ public int getSeconds() { return getFieldValueAsInt(DatatypeConstants.SECONDS); }
/** * <p>Get the years value of this <code>Duration</code> as an <code>int</code> or <code>0</code> if not present.</p> * * <p><code>getYears()</code> is a convenience method for * {@link #getField(DatatypeConstants.Field field) getField(DatatypeConstants.YEARS)}.</p> * * <p>As the return value is an <code>int</code>, an incorrect value will be returned for <code>Duration</code>s * with years that go beyond the range of an <code>int</code>. * Use {@link #getField(DatatypeConstants.Field field) getField(DatatypeConstants.YEARS)} to avoid possible loss of precision.</p> * * @return If the years field is present, return its value as an <code>int</code>, else return <code>0</code>. */ public int getYears() { return getFieldValueAsInt(DatatypeConstants.YEARS); }
/** * Obtains the value of the MONTHS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the MONTHS field. * * @return Months of this <code>Duration</code>. */ public int getMonths() { return getFieldValueAsInt(DatatypeConstants.MONTHS); }
/** * Obtains the value of the DAYS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the DAYS field. * * @return Days of this <code>Duration</code>. */ public int getDays() { return getFieldValueAsInt(DatatypeConstants.DAYS); }
/** * Obtains the value of the DAYS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the DAYS field. * * @return Days of this <code>Duration</code>. */ public int getDays() { return getFieldValueAsInt(DatatypeConstants.DAYS); }
/** * Obtains the value of the DAYS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the DAYS field. * * @return Days of this <code>Duration</code>. */ public int getDays() { return getFieldValueAsInt(DatatypeConstants.DAYS); }
/** * Obtains the value of the MONTHS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the MONTHS field. * * @return Months of this <code>Duration</code>. */ public int getMonths() { return getFieldValueAsInt(DatatypeConstants.MONTHS); }
/** * Obtains the value of the DAYS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the DAYS field. * * @return Days of this <code>Duration</code>. */ public int getDays() { return getFieldValueAsInt(DatatypeConstants.DAYS); }
/** * Obtains the value of the HOURS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the HOURS field. * * @return Hours of this <code>Duration</code>. * */ public int getHours() { return getFieldValueAsInt(DatatypeConstants.HOURS); }
/** * Obtains the value of the MONTHS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the MONTHS field. * * @return Months of this <code>Duration</code>. */ public int getMonths() { return getFieldValueAsInt(DatatypeConstants.MONTHS); }
/** * Obtains the value of the MONTHS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the MONTHS field. * * @return Months of this <code>Duration</code>. */ public int getMonths() { return getFieldValueAsInt(DatatypeConstants.MONTHS); }
/** * Obtains the value of the HOURS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the HOURS field. * * @return Hours of this <code>Duration</code>. * */ public int getHours() { return getFieldValueAsInt(DatatypeConstants.HOURS); }
/** * Obtains the value of the MINUTES field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the MINUTES field. * * @return Minutes of this <code>Duration</code>. * */ public int getMinutes() { return getFieldValueAsInt(DatatypeConstants.MINUTES); }
/** * Obtains the value of the DAYS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the DAYS field. * * @return Days of this <code>Duration</code>. */ public int getDays() { return getFieldValueAsInt(DatatypeConstants.DAYS); }
/** * Obtains the value of the MONTHS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the MONTHS field. * * @return Months of this <code>Duration</code>. */ public int getMonths() { return getFieldValueAsInt(DatatypeConstants.MONTHS); }
/** * Obtains the value of the HOURS field as an integer value, * or 0 if not present. * * This method works just like {@link #getYears()} except * that this method works on the HOURS field. * * @return Hours of this <code>Duration</code>. * */ public int getHours() { return getFieldValueAsInt(DatatypeConstants.HOURS); }