Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xmlbeans
Interface GDurationSpecification

All Known Implementing Classes:
  GDuration, GDurationBuilder

public interface GDurationSpecification

Represents an XML Schema-compatible duration.

Both the immutable GDuration and the mutable GDurationBuilder are GDurationSpecifications. Use this interface where you want to allow callers to pass any implementation of a GDuration.

See Also:
  `GDuration`

Method Summary
`int` | `compareToGDuration(GDurationSpecification duration)` Comparison to another GDuration.
`int` | `getDay()` Gets the day-of-month component.
`BigDecimal` | `getFraction()` Gets the fraction-of-second.
`int` | `getHour()` Gets the hour-of-day component.
`int` | `getMinute()` Gets the minute-of-hour component.
`int` | `getMonth()` Gets the month-of-year component.
`int` | `getSecond()` Gets the second-of-minute component.
`int` | `getSign()` Returns the sign of the duration: +1 is forwards and -1 is backwards in time.
`int` | `getYear()` Gets the year component.
`boolean` | `isImmutable()` True if this instance is immutable.
`boolean` | `isValid()` Returns true if all of the individual components of the duration are nonnegative.

Method Detail

### isImmutable

    public boolean isImmutable()

  True if this instance is immutable.

### getSign

    public int getSign()

  Returns the sign of the duration: +1 is forwards and -1 is backwards in time.

### getYear

    public int getYear()

  Gets the year component.

### getMonth

    public int getMonth()

  Gets the month-of-year component.

### getDay

    public int getDay()

  Gets the day-of-month component.

### getHour

    public int getHour()

  Gets the hour-of-day component.

### getMinute

    public int getMinute()

  Gets the minute-of-hour component.

### getSecond

    public int getSecond()

  Gets the second-of-minute component.

### getFraction

    public BigDecimal getFraction()

  Gets the fraction-of-second. Range from 0 (inclusive) to 1 (exclusive).

### isValid

    public boolean isValid()

  Returns true if all of the individual components of the duration are nonnegative.

### compareToGDuration

    public int compareToGDuration(GDurationSpecification duration)

  Comparison to another GDuration.
  - Returns -1 if this < date. (less-than)
  - Returns 0 if this == date. (equal)
  - Returns 1 if this > date. (greater-than)
  - Returns 2 if this <> date. (incomparable)
  Two instances are incomparable if they have different amounts of information.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD