Package de.latlon.ets.wfs20.core.utils
Class TimeUtils
java.lang.Object
de.latlon.ets.wfs20.core.utils.TimeUtils
Contains utility methods for parsing/reading dates.
- Author:
- Lyn Goltz
-
Method Summary
Modifier and TypeMethodDescriptionstatic Calendar[]calculateDateRange(String[] dateValues) Calculates the min and max date values from the given string.static StringcalculateValueBetween(long minTimeInMillis, long maxTimeInMillis) Calculates a date value in the range.static StringcalculateValueBetween(Calendar[] range) Calculates a date value in the range.
-
Method Details
-
calculateDateRange
Calculates the min and max date values from the given string.- Parameters:
dateValues- a list of dates, nevernull- Returns:
- the min and max value from the list ([0]= min , [1]=max). If the values list contains only one entry, min and max are equal. An empty array if the values list is empty.
-
calculateValueBetween
Calculates a date value in the range.- Parameters:
range- must contain exactly two values ([0]= min , [1]=max), min and may may be equal, nevernull- Returns:
- a value in the range, if min == max this value is returned, never
null
-
calculateValueBetween
Calculates a date value in the range.- Parameters:
minTimeInMillis- min datetime, nevernullmaxTimeInMillis- max dateTime, nevernull- Returns:
- a value in the range, never
null
-