Package com.webfirmframework.wffweb.util
Class CssTimeUtil
java.lang.Object
com.webfirmframework.wffweb.util.CssTimeUtil
a utility class for css time value manipulations.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object[]
getTimeValueAndUnit
(String cssValue) gets the time value and unit as an array.static Object[]
getTimeValueAsPremitiveAndUnit
(String cssValue) gets the time value and unit as an array.
-
Method Details
-
getTimeValueAsPremitiveAndUnit
gets the time value and unit as an array. For a cssValue555ms
, the returned array may be used asObject[] timeValueAsPremitiveAndUnit = CssTimeUtil.getTimeValueAsPremitiveAndUnit("555ms"); float value = (float) timeValueAsPremitiveAndUnit[0]; // the object will be equal to CssTimeUnit.MS CssTimeUnit unit = (CssTimeUnit) timeValueAsPremitiveAndUnit[1];
- Parameters:
cssValue
- the value from which the time value and unit required to be parsed, Eg:-555ms
.- Returns:
- an array containing time and unit. The time will be in the zeroth
index as
float
(primitive type) type and its unit in the first index as an object ofCssTimeUnit
. If the given cssValue is not a combination of time value and unit then an empty array (having time zero) will be returned. It will never return null. - Since:
- 1.0.0
-
getTimeValueAndUnit
gets the time value and unit as an array. For a cssValue555ms
, the returned array may be used asObject[] timeValueAndUnit = CssTimeUtil.getTimeValueAndUnit("555ms"); Float value = (Float) timeValueAndUnit[0]; // the object will be equal to CssTimeUnit.MS CssTimeUnit unit = (CssTimeUnit) timeValueAndUnit[1];
- Parameters:
cssValue
- the value from which the time value and unit required to be parsed, Eg:-555ms
.- Returns:
- an array containing time and unit. The time will be in the zeroth
index as
Float
(wrapper type) type and its unit in the first index as an object ofCssTimeUnit
. If the given cssValue is not a combination of time value and unit then an empty array (having time zero) will be returned. It will never return null. - Since:
- 1.0.0
-