groovy.time

## Class BaseDuration

- java.lang.Object
- - groovy.time.BaseDuration

All Implemented Interfaces:
  java.lang.Comparable<BaseDuration>

Direct Known Subclasses:
  DatumDependentDuration, Duration

    public abstract class BaseDuration
    extends java.lang.Object
    implements java.lang.Comparable<BaseDuration>

Base class for date and time durations.

See Also:
  `Duration`

### Nested Class Summary

Nested Classes
`static class` `BaseDuration.From`

### Field Summary

Fields
`protected int` `days`
`protected int` `hours`
`protected int` `millis`
`protected int` `minutes`
`protected int` `months`
`protected int` `seconds`
`protected int` `years`

### Constructor Summary

Constructors
`protected` `BaseDuration(int days, int hours, int minutes, int seconds, int millis)`
`protected` `BaseDuration(int years, int months, int days, int hours, int minutes, int seconds, int millis)`

### Method Summary

Methods
`int` `compareTo(BaseDuration otherDuration)`
`abstract java.util.Date` `getAgo()`
`int` `getDays()`
`abstract BaseDuration.From` `getFrom()`
`int` `getHours()`
`int` `getMillis()`
`int` `getMinutes()`
`int` `getMonths()`
`int` `getSeconds()`
`int` `getYears()`
`java.util.Date` `plus(java.util.Date date)`
`abstract long` `toMilliseconds()`
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### years

    protected final int years

#### months

    protected final int months

#### days

    protected final int days

#### hours

    protected final int hours

#### minutes

    protected final int minutes

#### seconds

    protected final int seconds

#### millis

    protected final int millis

### Constructor Detail

#### BaseDuration

    protected BaseDuration(int years,
                int months,
                int days,
                int hours,
                int minutes,
                int seconds,
                int millis)

#### BaseDuration

    protected BaseDuration(int days,
                int hours,
                int minutes,
                int seconds,
                int millis)

### Method Detail

#### getYears

    public int getYears()

#### getMonths

    public int getMonths()

#### getDays

    public int getDays()

#### getHours

    public int getHours()

#### getMinutes

    public int getMinutes()

#### getSeconds

    public int getSeconds()

#### getMillis

    public int getMillis()

#### plus

    public java.util.Date plus(java.util.Date date)

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### toMilliseconds

    public abstract long toMilliseconds()

#### getAgo

    public abstract java.util.Date getAgo()

#### getFrom

    public abstract BaseDuration.From getFrom()

#### compareTo

    public int compareTo(BaseDuration otherDuration)

Specified by:
  `compareTo` in interface `java.lang.Comparable<BaseDuration>`