Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public interface TemporalAmount

Known subtypesDuration, Period

An amount of time, such as a Duration or a Period.

Methods

public abstract long get(TemporalUnit unit)The amount of unit this holds.
public abstract List<TemporalUnit> getUnits()The units this amount is made of.
public abstract Temporal addTo(Temporal temporal)temporal moved forward by this amount.
public abstract Temporal subtractFrom(Temporal temporal)temporal moved back by this amount.

Method details

get

public abstract long get(TemporalUnit unit)
The amount of unit this holds.

getUnits

public abstract List<TemporalUnit> getUnits()
The units this amount is made of.

addTo

public abstract Temporal addTo(Temporal temporal)
temporal moved forward by this amount.

subtractFrom

public abstract Temporal subtractFrom(Temporal temporal)
temporal moved back by this amount.