public class TimeCalculations
extends java.lang.Object
| Constructor and Description |
|---|
TimeCalculations()
Creates new time calculations based on the default locale of the JVM.
|
TimeCalculations(java.util.Locale locale)
Creates new time calculations based on the designated locale, that is the
localised public holidays.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Calendar |
getWorkingDayAfter(java.util.Calendar fromDate,
int workingDaysToAdd)
Calculates the next working day when adding the designated amount of
workdays to the designated date.
|
static long |
timeLeft(long startInNanos,
long duration,
java.util.concurrent.TimeUnit unit)
Gets the time in the designated unit that is left of the designated
duration since the designated start.
|
public TimeCalculations()
public TimeCalculations(java.util.Locale locale)
locale - The locale to use for the time calculations.public java.util.Calendar getWorkingDayAfter(java.util.Calendar fromDate,
int workingDaysToAdd)
fromDate - The date to start the calculation.workingDaysToAdd - The amount of working days to add to the start date.public static long timeLeft(long startInNanos,
long duration,
java.util.concurrent.TimeUnit unit)
duration - (now - startInNanos) adjusted appropriately to the
designated time unit.startInNanos - The time in nanoseconds the waiting has started.duration - The time in the designated time unit, the waiting should
take.unit - The unit of the duration and the calculated time left.