public final class Functions
extends java.lang.Object
This class serves primarily as a consolidation point and dispatcher for worker methods located in diverse classes. All method calls made by the database server are redirected to those worker methods. However, since the database server knows nothing of the P2J wrapper types used by those methods to represent primitives, this class also performs a transformation to (on input) and from (on output) the P2J wrapper types. Thus, all parameters and return types for methods in this class are specified in terms of the standard J2SE wrapper types or primitive types.
The transformation handles conversion between null
J2SE
wrapper types and the implementation of unknown value
in the
P2J wrapper types. This is possible because unknown value maps to SQL
NULL in the backing database. However, certain data can be lost in the
transformation, and if these data are necessary, this mechanism should be
avoided. Instead, client-side where clause processing should be used in
these cases. Specifically, the following data are not represented by J2SE
wrappers or primitives and thus cannot be preserved during transformation:
decimal
value;
character
value;
date
value.
Operators
Constructor and Description |
---|
Functions() |
Modifier and Type | Method and Description |
---|---|
static java.sql.Date |
addInterval(java.sql.Date initial,
java.lang.Integer amount,
java.lang.String unit)
Computes a new date by adding respective number of time units.
|
static java.sql.Date |
addInterval(java.sql.Date initial,
java.lang.Long amount,
java.lang.String unit)
Computes a new date by adding respective number of time units.
|
static java.sql.Timestamp |
addInterval(java.sql.Timestamp initial,
java.lang.Integer amount,
java.lang.String unit)
Computes a new datetime by adding respective number of time units.
|
static java.sql.Timestamp |
addInterval(java.sql.Timestamp initial,
java.lang.Long amount,
java.lang.String unit)
Computes a new datetime by adding respective number of time units.
|
static java.lang.Boolean |
begins(java.lang.String a,
java.lang.String b)
Test whether one string begins with another case insensitively.
|
static java.lang.Boolean |
begins(java.lang.String a,
java.lang.String b,
boolean caseSensitive)
Test whether one string begins with another, optionally taking case
into account.
|
static java.lang.String |
caps(java.lang.String text)
Deprecated.
|
static java.lang.String |
chr(java.lang.Integer value)
Returns the character value of a numeric expression which must be
between 1 and 65534 (inclusive).
|
static java.lang.String |
chr(java.lang.Long value)
Returns the character value of a numeric expression which must be
between 1 and 65534 (inclusive).
|
static java.lang.String |
concat(java.lang.String a,
java.lang.String b)
Concatenate two strings using P2J character's default behavior.
|
static java.lang.String |
entry(java.lang.Integer i,
java.lang.String list)
Extract a string from a comma-delimited list represented by another
string, given its index within the list.
|
static java.lang.String |
entry(java.lang.Integer i,
java.lang.String list,
java.lang.String delimiter)
Extract a string from a delimited list represented by another string,
given its index within the list and the delimiter.
|
static java.lang.String |
entry(java.lang.Long i,
java.lang.String list)
Extract a string from a comma-delimited list represented by another
string, given its index within the list.
|
static java.lang.String |
entry(java.lang.Long i,
java.lang.String list,
java.lang.String delimiter)
Extract a string from a delimited list represented by another string,
given its index within the list and the delimiter.
|
static java.lang.Long |
getDay(java.sql.Date value)
Retrieve the day of the month (1-based) from a date.
|
static java.lang.Long |
getDay(java.sql.Timestamp value)
Retrieve the day of the month (1-based) from a datetime.
|
static java.lang.String |
getFWDVersion()
Helper function to return the FWD version string.
|
static java.lang.Long |
getInterval(java.sql.Date d1,
java.sql.Date d2,
java.lang.String unit)
Computes the interval between two dates.
|
static java.lang.Long |
getInterval(java.sql.Date d1,
java.sql.Timestamp d2,
java.lang.String unit)
Computes the interval between a date and a datetime.
|
static java.lang.Long |
getInterval(java.sql.Timestamp d1,
java.sql.Date d2,
java.lang.String unit)
Computes the interval between a datetime and a date.
|
static java.lang.Long |
getInterval(java.sql.Timestamp d1,
java.sql.Timestamp d2,
java.lang.String unit)
Computes the interval between two datetimes.
|
static java.lang.Long |
getMonth(java.sql.Date value)
Retrieve the month number (1-based) from a date.
|
static java.lang.Long |
getMonth(java.sql.Timestamp value)
Retrieve the month number (1-based) from a datetime.
|
static java.lang.Long |
getMtime()
Deprecated.
|
static java.lang.Long |
getMtime(java.sql.Timestamp value)
Retrieve the time since midnight in milliseconds.
|
static java.lang.Long |
getTimezone()
Deprecated.
|
static java.lang.Long |
getWeekday(java.sql.Date value)
Retrieve the week day number from a date.
|
static java.lang.Long |
getWeekday(java.sql.Timestamp value)
Retrieve the week day number from a datetime.
|
static java.lang.Long |
getYear(java.sql.Date value)
Retrieve the year number from a date.
|
static java.lang.Long |
getYear(java.sql.Timestamp value)
Retrieve the year number from a datetime.
|
static java.lang.Long |
indexOf(java.lang.String source,
java.lang.String target)
Retrieve the 1-based index at which one string is found within another,
or 0 if the string is not found.
|
static java.lang.Long |
indexOf(java.lang.String source,
java.lang.String target,
java.math.BigDecimal start)
Retrieve the 1-based index at which one string is found within another,
or 0 if the string is not found, starting at a particular index.
|
static java.lang.Long |
indexOf(java.lang.String source,
java.lang.String target,
java.math.BigDecimal start,
boolean caseSensitive)
Retrieve the 1-based index at which one string is found within another,
or 0 if the string is not found, starting at a particular index,
optionally taking case into account.
|
static java.lang.Long |
indexOf(java.lang.String source,
java.lang.String target,
java.lang.Integer start)
Retrieve the 1-based index at which one string is found within another,
or 0 if the string is not found, starting at a particular index.
|
static java.lang.Long |
indexOf(java.lang.String source,
java.lang.String target,
java.lang.Integer start,
boolean caseSensitive)
Retrieve the 1-based index at which one string is found within another,
or 0 if the string is not found, starting at a particular index,
optionally taking case into account.
|
static java.lang.Long |
indexOf(java.lang.String source,
java.lang.String target,
java.lang.Long start)
Retrieve the 1-based index at which one string is found within another,
or 0 if the string is not found, starting at a particular index.
|
static java.lang.Long |
indexOf(java.lang.String source,
java.lang.String target,
java.lang.Long start,
boolean caseSensitive)
Retrieve the 1-based index at which one string is found within another,
or 0 if the string is not found, starting at a particular index,
optionally taking case into account.
|
static java.lang.Long |
lengthOf(java.lang.String text)
Get the length of a string.
|
static java.lang.Long |
lengthOf(java.lang.String text,
java.lang.String type)
Get the length of a string.
|
static java.lang.Long |
lookup(java.lang.String entry,
java.lang.String list)
Look up the index of a string which represents an element in a
comma-delimited list represented by another string.
|
static java.lang.Long |
lookup(java.lang.String entry,
java.lang.String list,
java.lang.String delimiter)
Look up the index of a string which represents an element in a
delimited list represented by another string, using a specific
delimiter.
|
static java.lang.Long |
lookup(java.lang.String entry,
java.lang.String list,
java.lang.String delimiter,
java.lang.Boolean caseSensitive)
Look up the index of a string which represents an element in a
delimited list represented by another string, using a specific
delimiter, and optionally taking case into account.
|
static java.lang.String |
ltrimWS(java.lang.String text)
Trim white space from the left side of text.
|
static java.lang.String |
ltrimWS(java.lang.String text,
java.lang.String list)
Trim the specified characters from the left side of text.
|
static java.lang.Boolean |
matches(java.lang.String a,
java.lang.String b,
java.lang.Boolean windows)
Test for a pattern match within a string case insensitively.
|
static java.lang.Boolean |
matches(java.lang.String a,
java.lang.String b,
java.lang.Boolean caseSensitive,
java.lang.Boolean windows)
Test for a pattern match within a string, optionally taking case into account.
|
static java.lang.Boolean |
matchesList(java.lang.String list,
java.lang.String item)
Determine whether a comma-separated list contains a specific item.
|
static java.math.BigDecimal |
maximum(java.math.BigDecimal var1,
java.math.BigDecimal var2)
Returns the maximum from a list of values.
|
static java.math.BigDecimal |
maximum(java.math.BigDecimal var1,
java.lang.Integer var2)
Returns the maximum from a list of values.
|
static java.math.BigDecimal |
maximum(java.math.BigDecimal var1,
java.lang.Long var2)
Returns the maximum from a list of values.
|
static java.sql.Date |
maximum(java.sql.Date var1,
java.sql.Date var2)
Returns the maximum from a list of date values.
|
static java.math.BigDecimal |
maximum(java.lang.Integer var1,
java.math.BigDecimal var2)
Returns the maximum from a list of values.
|
static java.lang.Long |
maximum(java.lang.Integer var1,
java.lang.Integer var2)
Returns the maximum from a list of values.
|
static java.lang.Long |
maximum(java.lang.Integer var1,
java.lang.Long var2)
Returns the maximum from a list of values.
|
static java.math.BigDecimal |
maximum(java.lang.Long var1,
java.math.BigDecimal var2)
Returns the maximum from a list of values.
|
static java.lang.Long |
maximum(java.lang.Long var1,
java.lang.Integer var2)
Returns the maximum from a list of values.
|
static java.lang.Long |
maximum(java.lang.Long var1,
java.lang.Long var2)
Returns the maximum from a list of values.
|
static java.lang.String |
maximum(java.lang.String var1,
java.lang.String var2)
Returns the maximum from a list of values.
|
static java.sql.Timestamp |
maximum(java.sql.Timestamp var1,
java.sql.Timestamp var2)
Returns the maximum from a list of datetime values.
|
static java.math.BigDecimal |
minimum(java.math.BigDecimal var1,
java.math.BigDecimal var2)
Returns the minimum from a list of values.
|
static java.math.BigDecimal |
minimum(java.math.BigDecimal var1,
java.lang.Integer var2)
Returns the minimum from a list of values.
|
static java.math.BigDecimal |
minimum(java.math.BigDecimal var1,
java.lang.Long var2)
Returns the minimum from a list of values.
|
static java.sql.Date |
minimum(java.sql.Date var1,
java.sql.Date var2)
Returns the minimum from a list of date values.
|
static java.math.BigDecimal |
minimum(java.lang.Integer var1,
java.math.BigDecimal var2)
Returns the minimum from a list of values.
|
static java.lang.Long |
minimum(java.lang.Integer var1,
java.lang.Integer var2)
Returns the minimum from a list of values.
|
static java.lang.Long |
minimum(java.lang.Integer var1,
java.lang.Long var2)
Returns the minimum from a list of values.
|
static java.math.BigDecimal |
minimum(java.lang.Long var1,
java.math.BigDecimal var2)
Returns the minimum from a list of values.
|
static java.lang.Long |
minimum(java.lang.Long var1,
java.lang.Integer var2)
Returns the minimum from a list of values.
|
static java.lang.Long |
minimum(java.lang.Long var1,
java.lang.Long var2)
Returns the minimum from a list of values.
|
static java.lang.String |
minimum(java.lang.String var1,
java.lang.String var2)
Returns the minimum from a list of values.
|
static java.sql.Timestamp |
minimum(java.sql.Timestamp var1,
java.sql.Timestamp var2)
Returns the minimum from a list of datetime values.
|
static java.lang.Long |
numEntries(java.lang.String value)
Retrieve the number of entries in the variable.
|
static java.lang.Long |
numEntries(java.lang.String value,
java.lang.String separator)
Retrieve the number of entries in the variable.
|
static java.lang.String |
replace(java.lang.String source,
java.lang.String toReplace,
java.lang.String replacement)
Replaces the given values into the destination.
|
static java.lang.String |
reportPrecisionScale(java.math.BigDecimal num)
Helper function to report the precision and scale of a numeric value.
|
static java.math.BigDecimal |
roundDec(java.math.BigDecimal value)
Round a floating point number to 10 decimal places.
|
static java.math.BigDecimal |
roundDec(java.math.BigDecimal value,
java.lang.Integer precision)
Round a floating point number to a particular precision.
|
static java.math.BigDecimal |
roundDec(java.math.BigDecimal value,
java.lang.Long precision)
Round a floating point number to a particular precision.
|
static java.lang.String |
substringOf(java.lang.String text,
java.lang.Integer pos)
Extract a substring from a string, starting at a specific index.
|
static java.lang.String |
substringOf(java.lang.String text,
java.lang.Integer pos,
java.lang.Integer len)
Extract a substring of a specific length from a string, starting at a
specific index.
|
static java.lang.String |
substringOf(java.lang.String text,
java.lang.Integer pos,
java.lang.Integer len,
java.lang.String type)
Extract a substring of a specific length and Progress type from a
string, starting at a specific index.
|
static java.lang.String |
substringOf(java.lang.String text,
java.lang.Integer pos,
java.lang.Long len)
Extract a substring of a specific length from a string, starting at a
specific index.
|
static java.lang.String |
substringOf(java.lang.String text,
java.lang.Integer pos,
java.lang.Long len,
java.lang.String type)
Extract a substring of a specific length and Progress type from a
string, starting at a specific index.
|
static java.lang.String |
substringOf(java.lang.String text,
java.lang.Long pos)
Extract a substring from a string, starting at a specific index.
|
static java.lang.String |
substringOf(java.lang.String text,
java.lang.Long pos,
java.lang.Integer len)
Extract a substring of a specific length from a string, starting at a
specific index.
|
static java.lang.String |
substringOf(java.lang.String text,
java.lang.Long pos,
java.lang.Integer len,
java.lang.String type)
Extract a substring of a specific length and Progress type from a
string, starting at a specific index.
|
static java.lang.String |
substringOf(java.lang.String text,
java.lang.Long pos,
java.lang.Long len)
Extract a substring of a specific length from a string, starting at a
specific index.
|
static java.lang.String |
substringOf(java.lang.String text,
java.lang.Long pos,
java.lang.Long len,
java.lang.String type)
Extract a substring of a specific length and Progress type from a
string, starting at a specific index.
|
static java.sql.Date |
toDate(java.lang.Integer value)
Retrieve the date from a string variable.
|
static java.sql.Date |
toDate(java.lang.Integer month,
java.lang.Integer day,
java.lang.Integer year)
Retrieve the date from a month/day/year combination .
|
static java.sql.Date |
toDate(java.lang.Integer month,
java.lang.Integer day,
java.lang.Long year)
Retrieve the date from a month/day/year combination .
|
static java.sql.Date |
toDate(java.lang.Integer month,
java.lang.Long day,
java.lang.Integer year)
Retrieve the date from a month/day/year combination .
|
static java.sql.Date |
toDate(java.lang.Integer month,
java.lang.Long day,
java.lang.Long year)
Retrieve the date from a month/day/year combination .
|
static java.sql.Date |
toDate(java.lang.Long value)
Retrieve the date from a string variable.
|
static java.sql.Date |
toDate(java.lang.Long month,
java.lang.Integer day,
java.lang.Integer year)
Retrieve the date from a month/day/year combination .
|
static java.sql.Date |
toDate(java.lang.Long month,
java.lang.Integer day,
java.lang.Long year)
Retrieve the date from a month/day/year combination .
|
static java.sql.Date |
toDate(java.lang.Long month,
java.lang.Long day,
java.lang.Integer year)
Retrieve the date from a month/day/year combination .
|
static java.sql.Date |
toDate(java.lang.Long month,
java.lang.Long day,
java.lang.Long year)
Retrieve the date from a month/day/year combination .
|
static java.sql.Date |
toDate(java.lang.String text)
Deprecated.
|
static java.sql.Date |
toDate(java.lang.String text,
java.lang.String fmt,
java.lang.Integer wYear)
Retrieve the date from a string variable.
|
static java.sql.Date |
toDate(java.sql.Timestamp t)
Extract the date from a timestamp variable.
|
static java.sql.Timestamp |
toDatetime(java.sql.Date d)
Construct a timestamp from a date variable.
|
static java.sql.Timestamp |
toDatetime(java.sql.Date d,
java.lang.Integer mtime)
Retrieve the timestamp from a date/time combination.
|
static java.sql.Timestamp |
toDatetime(java.sql.Date d,
java.lang.Long mtime)
Retrieve the timestamp from a date/time combination.
|
static java.sql.Timestamp |
toDatetime(java.lang.Integer month,
java.lang.Integer day,
java.lang.Integer year,
java.lang.Integer hour,
java.lang.Integer minutes)
Retrieve the date from a month/day/year/hour/minutes combination .
|
static java.sql.Timestamp |
toDatetime(java.lang.Integer month,
java.lang.Integer day,
java.lang.Integer year,
java.lang.Integer hour,
java.lang.Integer minutes,
java.lang.Integer seconds)
Retrieve the timestamp from a month/day/year/hour/minutes./seconds combination .
|
static java.sql.Timestamp |
toDatetime(java.lang.Integer month,
java.lang.Integer day,
java.lang.Integer year,
java.lang.Integer hour,
java.lang.Integer minutes,
java.lang.Integer seconds,
java.lang.Integer millis)
Retrieve the timestamp from a month/day/year/hour/minutes/seconds/millis combination .
|
static java.sql.Timestamp |
toDatetime(java.lang.Long month,
java.lang.Long day,
java.lang.Long year,
java.lang.Long hour,
java.lang.Long minutes)
Retrieve the date from a month/day/year/hour/minutes combination .
|
static java.sql.Timestamp |
toDatetime(java.lang.Long month,
java.lang.Long day,
java.lang.Long year,
java.lang.Long hour,
java.lang.Long minutes,
java.lang.Long seconds)
Retrieve the timestamp from a month/day/year/hour/minutes./seconds combination .
|
static java.sql.Timestamp |
toDatetime(java.lang.Long month,
java.lang.Long day,
java.lang.Long year,
java.lang.Long hour,
java.lang.Long minutes,
java.lang.Long seconds,
java.lang.Long millis)
Retrieve the timestamp from a month/day/year/hour/minutes/seconds/millis combination .
|
static java.sql.Timestamp |
toDatetime(java.lang.String text)
Deprecated.
|
static java.sql.Timestamp |
toDatetime(java.lang.String text,
java.lang.String fmt,
java.lang.Integer wYear)
Retrieve the timestamp from a string variable.
|
static java.math.BigDecimal |
toDec(java.math.BigDecimal value)
Return the given
BigDecimal value. |
static java.math.BigDecimal |
toDec(java.math.BigDecimal value,
java.lang.Integer precision)
Return the given
BigDecimal value after applying the given
precision. |
static java.math.BigDecimal |
toDec(java.math.BigDecimal value,
java.lang.Long precision)
Return the given
BigDecimal value after applying the given
precision. |
static java.math.BigDecimal |
toDec(java.lang.Boolean value)
Transform the given value into a
decimal , then return it
as a J2SE BigDecimal , or null if unknown. |
static java.math.BigDecimal |
toDec(java.sql.Date value)
Transform the given value into a
decimal , then return it
as a J2SE BigDecimal , or null if unknown. |
static java.math.BigDecimal |
toDec(java.lang.Integer value)
Transform the given value into a
decimal , then return it
as a J2SE BigDecimal , or null if unknown. |
static java.math.BigDecimal |
toDec(java.lang.Long value)
Transform the given value into a
decimal , then return it
as a J2SE BigDecimal , or null if unknown. |
static java.math.BigDecimal |
toDec(java.lang.String value)
Transform the given value into a
decimal , then return it
as a J2SE BigDecimal , or null if unknown. |
static java.lang.Long |
toInt(java.math.BigDecimal value)
Transform the given value into an
integer , then return it
as a J2SE Long , or null if unknown. |
static java.lang.Long |
toInt(java.lang.Boolean value)
Transform the given value into an
integer , then return it
as a J2SE Long , or null if unknown. |
static java.lang.Long |
toInt(java.sql.Date value)
Transform the given value into an
integer , then return it as a J2SE
Long , or null if unknown. |
static java.lang.Long |
toInt(java.lang.Integer value)
Transform the given value into an
integer , then return it
as a J2SE Long , or null if unknown. |
static java.lang.Long |
toInt(java.lang.Long value)
Transform the given value into an
integer , then return it
as a J2SE Long , or null if unknown. |
static java.lang.Long |
toInt(java.lang.String value)
Transform the given value into an
integer , then return it
as a J2SE Long , or null if unknown. |
static java.lang.Long |
toInt64(java.math.BigDecimal value)
Transform the given value into an
int64 , then return it
as a J2SE Long , or null if unknown. |
static java.lang.Long |
toInt64(java.lang.Boolean value)
Transform the given value into an
int64 , then return it
as a J2SE Long , or null if unknown. |
static java.lang.Long |
toInt64(java.sql.Date value)
Transform the given value into an
int64 , then return it as a J2SE
Long , or null if unknown. |
static java.lang.Long |
toInt64(java.lang.Integer value)
Transform the given value into an
integer , then return it
as a J2SE Long , or null if unknown. |
static java.lang.Long |
toInt64(java.lang.Long value)
Transform the given value into an
int64 , then return it
as a J2SE Long , or null if unknown. |
static java.lang.Long |
toInt64(java.lang.String value)
Transform the given value into an
int64 , then return it
as a J2SE Long , or null if unknown. |
static java.lang.Boolean |
toLogical(java.lang.String var)
Returns logical representation of a char variable from a format of type "true/false".
|
static java.lang.Boolean |
toLogical(java.lang.String var,
java.lang.String format)
Returns logical representation of a char variable from a format of type "true/false".
|
private static java.lang.Long |
toLong(java.lang.Integer i)
Rewraps an Integer value into a Long.
|
static java.lang.Long |
toRowid(java.lang.String text)
Returns the rowid representation of a String value, as a Long.
|
static java.lang.String |
toString(java.math.BigDecimal value)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.math.BigDecimal value,
java.lang.String fmt)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.lang.Boolean value)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.lang.Boolean value,
java.lang.String fmt)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.sql.Date value)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.sql.Date value,
java.lang.String fmt)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.lang.Integer value)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.lang.Integer value,
java.lang.String fmt)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.lang.Long value)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.lang.Long value,
java.lang.String fmt)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.lang.String value)
Simply return the given string.
|
static java.lang.String |
toString(java.lang.String value,
java.lang.String fmt)
Transform the given value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.sql.Timestamp value)
Transform the given datetime value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
toString(java.sql.Timestamp value,
java.lang.String fmt)
Transform the given datetime value into an
character , then return
it as a J2SE String , or null if unknown. |
static java.lang.String |
trimWS(java.lang.String text)
Trim white space from the left and right side of text.
|
static java.lang.String |
trimWS(java.lang.String text,
java.lang.String trimChars)
Trim special characters listed in
trimChars from the left and right side of text. |
public static java.lang.Boolean begins(java.lang.String a, java.lang.String b)
TextOps.begins(Text, character)
public static java.lang.Boolean begins(java.lang.String a, java.lang.String b, boolean caseSensitive)
TextOps.begins(String, String, boolean)
public static java.lang.String chr(java.lang.Long value)
character.chr(long)
public static java.lang.String chr(java.lang.Integer value)
character.chr(long)
public static java.lang.Boolean matches(java.lang.String a, java.lang.String b, java.lang.Boolean windows)
public static java.lang.Boolean matches(java.lang.String a, java.lang.String b, java.lang.Boolean caseSensitive, java.lang.Boolean windows)
public static java.lang.Long indexOf(java.lang.String source, java.lang.String target)
TextOps.indexOf(Text, Text)
public static java.lang.Long indexOf(java.lang.String source, java.lang.String target, java.lang.Long start)
TextOps.indexOf(Text, Text, NumberType)
public static java.lang.Long indexOf(java.lang.String source, java.lang.String target, java.lang.Integer start)
TextOps.indexOf(Text, Text, NumberType)
public static java.lang.Long indexOf(java.lang.String source, java.lang.String target, java.math.BigDecimal start)
TextOps.indexOf(Text, Text, NumberType)
public static java.lang.Long indexOf(java.lang.String source, java.lang.String target, java.lang.Long start, boolean caseSensitive)
public static java.lang.Long indexOf(java.lang.String source, java.lang.String target, java.lang.Integer start, boolean caseSensitive)
public static java.lang.Long indexOf(java.lang.String source, java.lang.String target, java.math.BigDecimal start, boolean caseSensitive)
public static java.lang.Long toInt(java.lang.Boolean value)
integer
, then return it
as a J2SE Long
, or null
if unknown.integer.integer(java.lang.Boolean)
public static java.lang.Long toInt(java.lang.Long value)
integer
, then return it
as a J2SE Long
, or null
if unknown.integer.integer(java.lang.Number)
public static java.lang.Long toInt(java.lang.Integer value)
integer
, then return it
as a J2SE Long
, or null
if unknown.integer.integer(java.lang.Number)
public static java.lang.Long toInt(java.math.BigDecimal value)
integer
, then return it
as a J2SE Long
, or null
if unknown.integer.integer(java.lang.Number)
public static java.lang.Long toInt(java.lang.String value)
integer
, then return it
as a J2SE Long
, or null
if unknown.integer.integer(java.lang.String)
public static java.lang.Long toInt(java.sql.Date value)
integer
, then return it as a J2SE
Long
, or null
if unknown.date.longValue()
public static java.lang.Long toInt64(java.lang.Boolean value)
int64
, then return it
as a J2SE Long
, or null
if unknown.int64.int64(java.lang.Boolean)
public static java.lang.Long toInt64(java.lang.Long value)
int64
, then return it
as a J2SE Long
, or null
if unknown.int64.int64(java.lang.Number)
public static java.lang.Long toInt64(java.lang.Integer value)
integer
, then return it
as a J2SE Long
, or null
if unknown.int64.int64(java.lang.Number)
public static java.lang.Long toInt64(java.math.BigDecimal value)
int64
, then return it
as a J2SE Long
, or null
if unknown.int64.int64(java.lang.Number)
public static java.lang.Long toInt64(java.lang.String value)
int64
, then return it
as a J2SE Long
, or null
if unknown.int64.int64(java.lang.String)
public static java.lang.Long toInt64(java.sql.Date value)
int64
, then return it as a J2SE
Long
, or null
if unknown.date.longValue()
public static java.math.BigDecimal toDec(java.lang.Boolean value)
decimal
, then return it
as a J2SE BigDecimal
, or null
if unknown.public static java.math.BigDecimal toDec(java.lang.Long value)
decimal
, then return it
as a J2SE BigDecimal
, or null
if unknown.decimal.decimal(java.lang.Number)
public static java.math.BigDecimal toDec(java.lang.Integer value)
decimal
, then return it
as a J2SE BigDecimal
, or null
if unknown.decimal.decimal(java.lang.Number)
public static java.math.BigDecimal toDec(java.math.BigDecimal value)
BigDecimal
value. Do not alter the
precision.value
- decimal numeric value.public static java.math.BigDecimal toDec(java.math.BigDecimal value, java.lang.Long precision)
BigDecimal
value after applying the given
precision. This function is provided for the special case of a literal
value, where the default precision derived from that literal is not
appropriate.value
- Decimal numeric value.precision
- Precision to apply.public static java.math.BigDecimal toDec(java.math.BigDecimal value, java.lang.Integer precision)
BigDecimal
value after applying the given
precision. This function is provided for the special case of a literal
value, where the default precision derived from that literal is not
appropriate.value
- Decimal numeric value.precision
- Precision to apply.public static java.math.BigDecimal toDec(java.lang.String value)
decimal
, then return it
as a J2SE BigDecimal
, or null
if unknown.decimal.decimal(java.lang.String)
public static java.math.BigDecimal toDec(java.sql.Date value)
decimal
, then return it
as a J2SE BigDecimal
, or null
if unknown.public static java.lang.String toString(java.lang.Boolean value)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(boolean)
public static java.lang.String toString(java.lang.Boolean value, java.lang.String fmt)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(boolean,String)
public static java.lang.String toString(java.lang.Long value)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(long)
public static java.lang.String toString(java.lang.Integer value)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(long)
public static java.lang.String toString(java.lang.Long value, java.lang.String fmt)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(long,String)
public static java.lang.String toString(java.lang.Integer value, java.lang.String fmt)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(long,String)
public static java.lang.String toString(java.sql.Date value)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(BaseDataType)
public static java.lang.String toString(java.sql.Date value, java.lang.String fmt)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(BaseDataType,String)
public static java.lang.String toString(java.sql.Timestamp value)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(BaseDataType)
public static java.lang.String toString(java.sql.Timestamp value, java.lang.String fmt)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(BaseDataType,String)
public static java.lang.String toString(java.math.BigDecimal value)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(double)
public static java.lang.String toString(java.math.BigDecimal value, java.lang.String fmt)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(double,String)
public static java.lang.String toString(java.lang.String value)
character
, then back to a J2SE String
,
but this method short-circuits that unnecessary, round trip.value
- String to be returned.value
parameter, unchanged.public static java.lang.String toString(java.lang.String value, java.lang.String fmt)
character
, then return
it as a J2SE String
, or null
if unknown.character.valueOf(String,String)
public static java.lang.Long toRowid(java.lang.String text)
rowid.parseRowidString(java.lang.String)
public static java.lang.String concat(java.lang.String a, java.lang.String b)
String
, or null
if
unknown.TextOps.concat(java.lang.Object...)
public static java.lang.String substringOf(java.lang.String text, java.lang.Long pos)
public static java.lang.String substringOf(java.lang.String text, java.lang.Integer pos)
public static java.lang.String substringOf(java.lang.String text, java.lang.Long pos, java.lang.Long len)
public static java.lang.String substringOf(java.lang.String text, java.lang.Long pos, java.lang.Integer len)
public static java.lang.String substringOf(java.lang.String text, java.lang.Integer pos, java.lang.Long len)
public static java.lang.String substringOf(java.lang.String text, java.lang.Integer pos, java.lang.Integer len)
public static java.lang.String substringOf(java.lang.String text, java.lang.Long pos, java.lang.Long len, java.lang.String type)
public static java.lang.String substringOf(java.lang.String text, java.lang.Long pos, java.lang.Integer len, java.lang.String type)
public static java.lang.String substringOf(java.lang.String text, java.lang.Integer pos, java.lang.Long len, java.lang.String type)
public static java.lang.String substringOf(java.lang.String text, java.lang.Integer pos, java.lang.Integer len, java.lang.String type)
public static java.math.BigDecimal maximum(java.math.BigDecimal var1, java.math.BigDecimal var2)
var1
- Value 1.var2
- Value 2.public static java.math.BigDecimal maximum(java.lang.Long var1, java.math.BigDecimal var2)
var1
- Value 1.var2
- Value 2.public static java.math.BigDecimal maximum(java.lang.Integer var1, java.math.BigDecimal var2)
var1
- Value 1.var2
- Value 2.public static java.math.BigDecimal maximum(java.math.BigDecimal var1, java.lang.Long var2)
var1
- Value 1.var2
- Value 2.public static java.math.BigDecimal maximum(java.math.BigDecimal var1, java.lang.Integer var2)
var1
- Value 1.var2
- Value 2.public static java.lang.Long maximum(java.lang.Long var1, java.lang.Long var2)
var1
- Value 1.var2
- Value 2.public static java.lang.Long maximum(java.lang.Long var1, java.lang.Integer var2)
var1
- Value 1.var2
- Value 2.public static java.lang.Long maximum(java.lang.Integer var1, java.lang.Long var2)
var1
- Value 1.var2
- Value 2.public static java.lang.Long maximum(java.lang.Integer var1, java.lang.Integer var2)
var1
- Value 1.var2
- Value 2.public static java.lang.String maximum(java.lang.String var1, java.lang.String var2)
var1
- Value 1.var2
- Value 2.public static java.sql.Date maximum(java.sql.Date var1, java.sql.Date var2)
var1
- Value 1.var2
- Value 2.public static java.sql.Timestamp maximum(java.sql.Timestamp var1, java.sql.Timestamp var2)
var1
- Value 1.var2
- Value 2.public static java.math.BigDecimal minimum(java.math.BigDecimal var1, java.math.BigDecimal var2)
var1
- Value 1.var2
- Value 2.public static java.math.BigDecimal minimum(java.lang.Long var1, java.math.BigDecimal var2)
var1
- Value 1.var2
- Value 2.public static java.math.BigDecimal minimum(java.lang.Integer var1, java.math.BigDecimal var2)
var1
- Value 1.var2
- Value 2.public static java.math.BigDecimal minimum(java.math.BigDecimal var1, java.lang.Long var2)
var1
- Value 1.var2
- Value 2.public static java.math.BigDecimal minimum(java.math.BigDecimal var1, java.lang.Integer var2)
var1
- Value 1.var2
- Value 2.public static java.lang.Long minimum(java.lang.Long var1, java.lang.Long var2)
var1
- Value 1.var2
- Value 2.public static java.lang.Long minimum(java.lang.Long var1, java.lang.Integer var2)
var1
- Value 1.var2
- Value 2.public static java.lang.Long minimum(java.lang.Integer var1, java.lang.Long var2)
var1
- Value 1.var2
- Value 2.public static java.lang.Long minimum(java.lang.Integer var1, java.lang.Integer var2)
var1
- Value 1.var2
- Value 2.public static java.lang.String minimum(java.lang.String var1, java.lang.String var2)
var1
- Value 1.var2
- Value 2.public static java.sql.Date minimum(java.sql.Date var1, java.sql.Date var2)
var1
- Value 1.var2
- Value 2.public static java.sql.Timestamp minimum(java.sql.Timestamp var1, java.sql.Timestamp var2)
var1
- Value 1.var2
- Value 2.public static java.lang.Boolean toLogical(java.lang.String var)
var
- The variable we want to match against the logical formatpublic static java.lang.Boolean toLogical(java.lang.String var, java.lang.String format)
var
- The variable we want to match against the logical formatformat
- The format of form "leftLogical/rightLogical" in which leftLogical will represent
true
and rightLogical represents false
public static java.lang.String replace(java.lang.String source, java.lang.String toReplace, java.lang.String replacement)
public static java.lang.String ltrimWS(java.lang.String text)
public static java.lang.String ltrimWS(java.lang.String text, java.lang.String list)
TextOps.leftTrim(String, String)
public static java.lang.String trimWS(java.lang.String text)
public static java.lang.String trimWS(java.lang.String text, java.lang.String trimChars)
trimChars
from the left and right side of text.@Deprecated public static java.lang.String caps(java.lang.String text)
TextOps.toUpperCase(String, boolean)
public static java.lang.Long numEntries(java.lang.String value)
TextOps.numEntries(Text)
public static java.lang.Long numEntries(java.lang.String value, java.lang.String separator)
TextOps.numEntries(Text, String)
public static java.lang.Long lengthOf(java.lang.String text)
TextOps.length(Text)
public static java.lang.Long lengthOf(java.lang.String text, java.lang.String type)
TextOps.length(Text)
public static java.lang.String entry(java.lang.Long i, java.lang.String list)
public static java.lang.String entry(java.lang.Integer i, java.lang.String list)
public static java.lang.String entry(java.lang.Long i, java.lang.String list, java.lang.String delimiter)
public static java.lang.String entry(java.lang.Integer i, java.lang.String list, java.lang.String delimiter)
public static java.lang.Long lookup(java.lang.String entry, java.lang.String list)
TextOps.lookup(character, Text)
public static java.lang.Long lookup(java.lang.String entry, java.lang.String list, java.lang.String delimiter)
public static java.lang.Long lookup(java.lang.String entry, java.lang.String list, java.lang.String delimiter, java.lang.Boolean caseSensitive)
public static java.lang.Boolean matchesList(java.lang.String list, java.lang.String item)
TextOps.matchesList(Text, character)
public static java.math.BigDecimal roundDec(java.math.BigDecimal value)
public static java.math.BigDecimal roundDec(java.math.BigDecimal value, java.lang.Long precision)
public static java.math.BigDecimal roundDec(java.math.BigDecimal value, java.lang.Integer precision)
@Deprecated public static java.sql.Date toDate(java.lang.String text)
text
- The text value from which we return the new date.public static java.sql.Date toDate(java.lang.String text, java.lang.String fmt, java.lang.Integer wYear)
text
- The text value from which we return the new date.fmt
- The format string used for date conversion.wYear
- The start of the 100 year window used for conversion when year is in 2-digits.public static java.sql.Date toDate(java.lang.Long value)
value
- The integer representing the number of days from the Progress 4GL base data time.public static java.sql.Date toDate(java.lang.Integer value)
value
- The integer representing the number of days from the Progress 4GL base data time.public static java.sql.Date toDate(java.lang.Long month, java.lang.Long day, java.lang.Long year)
month
- The month of the date.day
- The day of the date.year
- The year of the date.public static java.sql.Date toDate(java.lang.Long month, java.lang.Long day, java.lang.Integer year)
month
- The month of the date.day
- The day of the date.year
- The year of the date.public static java.sql.Date toDate(java.lang.Long month, java.lang.Integer day, java.lang.Long year)
month
- The month of the date.day
- The day of the date.year
- The year of the date.public static java.sql.Date toDate(java.lang.Long month, java.lang.Integer day, java.lang.Integer year)
month
- The month of the date.day
- The day of the date.year
- The year of the date.public static java.sql.Date toDate(java.lang.Integer month, java.lang.Long day, java.lang.Long year)
month
- The month of the date.day
- The day of the date.year
- The year of the date.public static java.sql.Date toDate(java.lang.Integer month, java.lang.Long day, java.lang.Integer year)
month
- The month of the date.day
- The day of the date.year
- The year of the date.public static java.sql.Date toDate(java.lang.Integer month, java.lang.Integer day, java.lang.Long year)
month
- The month of the date.day
- The day of the date.year
- The year of the date.public static java.sql.Date toDate(java.lang.Integer month, java.lang.Integer day, java.lang.Integer year)
month
- The month of the date.day
- The day of the date.year
- The year of the date.public static java.sql.Date toDate(java.sql.Timestamp t)
t
- The timestamp.public static java.sql.Timestamp toDatetime(java.sql.Date d)
d
- The date.public static java.sql.Timestamp toDatetime(java.sql.Date d, java.lang.Long mtime)
d
- The date.mtime
- Times since midnight in milliseconds.public static java.sql.Timestamp toDatetime(java.sql.Date d, java.lang.Integer mtime)
d
- The date.mtime
- Times since midnight in milliseconds.public static java.sql.Timestamp toDatetime(java.lang.Long month, java.lang.Long day, java.lang.Long year, java.lang.Long hour, java.lang.Long minutes)
month
- The month of the date.day
- The day of the date.year
- The year of the date.hour
- The hour of the day.minutes
- The minutes of the hour.public static java.sql.Timestamp toDatetime(java.lang.Integer month, java.lang.Integer day, java.lang.Integer year, java.lang.Integer hour, java.lang.Integer minutes)
month
- The month of the date.day
- The day of the date.year
- The year of the date.hour
- The hour of the day.minutes
- The minutes of the hour.public static java.sql.Timestamp toDatetime(java.lang.Long month, java.lang.Long day, java.lang.Long year, java.lang.Long hour, java.lang.Long minutes, java.lang.Long seconds)
month
- The month of the date.day
- The day of the date.year
- The year of the date.hour
- The hour of the day.minutes
- The minutes of the hour.seconds
- The seconds in the minute.public static java.sql.Timestamp toDatetime(java.lang.Integer month, java.lang.Integer day, java.lang.Integer year, java.lang.Integer hour, java.lang.Integer minutes, java.lang.Integer seconds)
month
- The month of the date.day
- The day of the date.year
- The year of the date.hour
- The hour of the day.minutes
- The minutes of the hour.seconds
- The seconds in the minute.public static java.sql.Timestamp toDatetime(java.lang.Long month, java.lang.Long day, java.lang.Long year, java.lang.Long hour, java.lang.Long minutes, java.lang.Long seconds, java.lang.Long millis)
month
- The month of the date.day
- The day of the date.year
- The year of the date.hour
- The hour of the day.minutes
- The minutes of the hour.seconds
- The seconds in the minute.millis
- The milliseconds of the second.public static java.sql.Timestamp toDatetime(java.lang.Integer month, java.lang.Integer day, java.lang.Integer year, java.lang.Integer hour, java.lang.Integer minutes, java.lang.Integer seconds, java.lang.Integer millis)
month
- The month of the date.day
- The day of the date.year
- The year of the date.hour
- The hour of the day.minutes
- The minutes of the hour.seconds
- The seconds in the minute.millis
- The milliseconds of the second.@Deprecated public static java.sql.Timestamp toDatetime(java.lang.String text)
text
- The text value from which we return the new date.public static java.sql.Timestamp toDatetime(java.lang.String text, java.lang.String fmt, java.lang.Integer wYear)
text
- The text value from which we return the new date.fmt
- The format string used for date conversion.wYear
- The start of the 100 year window used for conversion when year is in 2-digits.public static java.lang.Long getWeekday(java.sql.Timestamp value)
public static java.lang.Long getYear(java.sql.Timestamp value)
date.year(com.goldencode.p2j.util.date)
public static java.lang.Long getMonth(java.sql.Timestamp value)
date.month(com.goldencode.p2j.util.date)
public static java.lang.Long getDay(java.sql.Timestamp value)
date.year(com.goldencode.p2j.util.date)
public static java.lang.Long getWeekday(java.sql.Date value)
public static java.lang.Long getYear(java.sql.Date value)
date.year(com.goldencode.p2j.util.date)
public static java.lang.Long getMonth(java.sql.Date value)
date.month(com.goldencode.p2j.util.date)
public static java.lang.Long getDay(java.sql.Date value)
date.year(com.goldencode.p2j.util.date)
@Deprecated public static java.lang.Long getMtime()
Note:
This function is deprecated and should not exist as it should not be invoked on
sql-server side where the system clock is most likely different.
datetime.millisecondsSinceMidnight()
public static java.lang.Long getMtime(java.sql.Timestamp value)
datetime.getTime()
public static java.lang.Long getInterval(java.sql.Timestamp d1, java.sql.Timestamp d2, java.lang.String unit)
unit
units.d1
- The first date.d2
- The second date.unit
- The unit to measure the interval.DateOps.interval(date, date, String)
public static java.lang.Long getInterval(java.sql.Date d1, java.sql.Timestamp d2, java.lang.String unit)
unit
units.d1
- The date is the 1st reference.d2
- The datetime is the 2nd reference.unit
- The unit to measure the interval.DateOps.interval(date, date, String)
public static java.lang.Long getInterval(java.sql.Timestamp d1, java.sql.Date d2, java.lang.String unit)
unit
units.d1
- The datetime is the 1st reference.d2
- The date is the 2nd reference.unit
- The unit to measure the interval.DateOps.interval(date, date, String)
public static java.lang.Long getInterval(java.sql.Date d1, java.sql.Date d2, java.lang.String unit)
unit
units.d1
- The first date.d2
- The second date.unit
- The unit to measure the interval.DateOps.interval(date, date, String)
public static java.sql.Date addInterval(java.sql.Date initial, java.lang.Long amount, java.lang.String unit)
initial
- The first date.amount
- The count of units to be added.unit
- The unit to measure the interval.DateOps.addInterval(date, long, String)
public static java.sql.Date addInterval(java.sql.Date initial, java.lang.Integer amount, java.lang.String unit)
initial
- The first date.amount
- The count of units to be added.unit
- The unit to measure the interval.DateOps.addInterval(date, long, String)
public static java.sql.Timestamp addInterval(java.sql.Timestamp initial, java.lang.Long amount, java.lang.String unit)
initial
- The first datetime.amount
- The count of units to be added.unit
- The unit to measure the interval.DateOps.addInterval(date, long, String)
public static java.sql.Timestamp addInterval(java.sql.Timestamp initial, java.lang.Integer amount, java.lang.String unit)
initial
- The first datetime.amount
- The count of units to be added.unit
- The unit to measure the interval.DateOps.addInterval(date, long, String)
@Deprecated public static java.lang.Long getTimezone()
Note:
This function is deprecated and should not exist as it should not be invoked on
sql-server side where the value of SESSION:TIMEZONE
is not accessible.
date.getDefaultOffset()
public static java.lang.String reportPrecisionScale(java.math.BigDecimal num)
num
- Numeric value.(p,s)
.public static java.lang.String getFWDVersion()
private static java.lang.Long toLong(java.lang.Integer i)
i
- The java.lang.Integer to be rewrapped.null
if
the argument was null
.