public class Period
extends Object
GDK enhancements for Period.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static Period |
between(Period type, Year startInclusive, Year endExclusive)Obtains a Period consisting of the number of years between two Year instances. |
|
public static Period |
between(Period type, YearMonth startInclusive, YearMonth endExclusive)Obtains a Period consisting of the number of years and months between two YearMonth instances. |
|
public Period |
minus(long days)Returns a Period that is days days shorter than this period.
|
|
public Period |
multiply(int scalar)Supports the multiply operator; equivalent to calling the Period.multipliedBy method. |
|
public Period |
negative()Supports the unary minus operator; equivalent to calling the Period.negated method. |
|
public Period |
next()Returns a Period that is one day longer than this period. |
|
public Period |
plus(long days)Returns a Period that is days days longer than this period.
|
|
public Period |
positive()Supports the unary plus operator; returns a Period with all unit values positive. |
|
public Period |
previous()Returns a Period that is one day shorter than this period. |
| Methods inherited from class | Name |
|---|---|
class Object |
addShutdownHook, any, any, asBoolean, asType, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits |
Obtains a Period consisting of the number of years between two Year instances. The months and days of the Period will be zero. The result of this method can be a negative period if the end is before the start.
type - placeholder variable used by Groovy categories; ignored for default static methodsstartInclusive - the start Year, inclusive, not nullendExclusive - the end Year, exclusive, not nullObtains a Period consisting of the number of years and months between two YearMonth instances. The days of the Period will be zero. The result of this method can be a negative period if the end is before the start.
type - placeholder variable used by Groovy categories; ignored for default static methodsstartInclusive - the start YearMonth, inclusive, not nullendExclusive - the end YearMonth, exclusive, not null Returns a Period that is days days shorter than this period.
No normalization is performed.
days - the number of days to decrease this Period bySupports the multiply operator; equivalent to calling the Period.multipliedBy method.
scalar - a scalar to multiply each unit bySupports the unary minus operator; equivalent to calling the Period.negated method.
Returns a Period that is one day longer than this period. No normalization is performed.
Returns a Period that is days days longer than this period.
No normalization is performed.
days - the number of days to increase this Period bySupports the unary plus operator; returns a Period with all unit values positive. For example, a period of "2 years, -3 months, and -4 days" would result in a period of "2 years, 3 months, and 4 days." No normalization is performed.