Package com.api.jsonata4java.expressions
Class JS4JUtils
java.lang.Object
com.api.jsonata4java.expressions.JS4JUtils
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intconvertTimeZoneToMilliseconds(String strTimeZone) Converts a timezone of the format +/-hhmm to millisecondsstatic StringpadRight(int iIn, int iWidth, char cPad) Helper method to create strings of the form "nn000".static StringpadRight(long lIn, int iWidth, char cPad) Helper method to create strings of the form "nn000".static StringCreates a new String padded on its right side with the supplied pad character guaranteed to be the supplied length.
-
Field Details
-
s_iDayMilliseconds
public static final int s_iDayMilliseconds- See Also:
-
s_iHourMilliseconds
public static final int s_iHourMilliseconds- See Also:
-
s_iMinuteMilliseconds
public static final int s_iMinuteMilliseconds- See Also:
-
-
Constructor Details
-
JS4JUtils
public JS4JUtils()
-
-
Method Details
-
convertTimeZoneToMilliseconds
Converts a timezone of the format +/-hhmm to milliseconds- Parameters:
strTimeZone- timezone offset from Greenwich Mean Time (GMT) for example "-0500" is Eastern Standard Time, "-0400" is Eastern Daylight Time, "+0000" is Greenwich Mean Time, and "+0100" is the offset for Europe/Paris.- Returns:
- milliseconds from Greenwich Mean Time
-
padRight
Helper method to create strings of the form "nn000".- Parameters:
lIn- long value to be right justified with leading characters in the returned String.iWidth- integer value of the width of the returned String.cPad- character value to be used to pad the right portion of the returned String to make it as wide as the specified iWidth parameter. For example, calling toRightPaddedString(iNum,4,'0') would result in "4500" if iNum == 45, or "4000" if iNum == 4.- Returns:
- String containing the right justified value, padded to the specified with the specified pad character.
-
padRight
Helper method to create strings of the form "nn000".- Parameters:
iIn- integer value to be right justified with leading characters in the returned String.iWidth- integer value of the width of the returned String.cPad- character value to be used to pad the right portion of the returned String to make it as wide as the specified iWidth parameter. For example, calling toRightPaddedString(iNum,4,'0') would result in "4500" if iNum == 45, or "4000" if iNum == 4.- Returns:
- String containing the right justified value, padded to the specified with the specified pad character.
-
padRight
Creates a new String padded on its right side with the supplied pad character guaranteed to be the supplied length. If the supplied length is less than or equal to the length of the supplied string, the supplied string is returned. If the supplied string is null, a new string is returned filled with the supplied pad character that is as long as the supplied length.- Parameters:
strInput-iMax-cPadChar-- Returns:
- formatted string with padding
-