public final class TextOps
extends java.lang.Object
The following is the mapping of Progress language features to the corresponding feature in this class:
+ operator (concatenation)concat(java.lang.Object...)
num-entries functionnumEntries(com.goldencode.p2j.util.Text)
begins operatorbegins(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
and_begins(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
matches operatormatches(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, boolean)
and_matches(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, boolean)
can-do functionmatchesList(com.goldencode.p2j.util.Text)
caps functiontoUpperCase(T)
compare functioncompare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
entry functionentry(com.goldencode.p2j.util.NumberType, T, com.goldencode.p2j.util.character)
index functionindexOf(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.NumberType)
lc functiontoLowerCase(T)
left-trim functionleftTrim(T, com.goldencode.p2j.util.character)
length functionlength(com.goldencode.p2j.util.Text)
andbyteLength(java.lang.String)
lookup functionlookup(com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
maximum functionmaximum(T...)
minimum functionminimum(T...)
r-index functionlastIndexOf(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.NumberType)
replace functionreplaceAll(T, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.Text)
right-trim functionrightTrim(T, com.goldencode.p2j.util.character)
substitute functionsubstitute(T, java.lang.Object...)
substring functionsubstring(T, com.goldencode.p2j.util.NumberType, com.goldencode.p2j.util.NumberType, java.lang.String)
trim functiontrim(T, com.goldencode.p2j.util.character)
entry language statementText.replaceEntry(double, char, java.lang.String)
overlay language statementText.overlay(com.goldencode.p2j.util.Text, double)
substring language statementText.replace(com.goldencode.p2j.util.Text, double)
There are convenience versions of the begins and matches operators that
directly return boolean
values such that unwrapping is not
needed. These are named the same as the operator methods above except
there is no 'With' appended. For example, the begins operator is
begins(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.
The following is the list of Progress language features which optionally
return a character
instance that reflects the case-sensitivity
of the operands or input values:
+ operator caps functiontoUpperCase(T)
lc functiontoLowerCase(T)
left-trim functionleftTrim(T, com.goldencode.p2j.util.character)
maximum functionmaximum(T...)
minimum functionminimum(T...)
replace functionreplaceAll(T, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.Text)
right-trim functionrightTrim(T, com.goldencode.p2j.util.character)
substring functionsubstring(T, com.goldencode.p2j.util.NumberType, com.goldencode.p2j.util.NumberType, java.lang.String)
trim functiontrim(T, com.goldencode.p2j.util.character)
Strangely enough, the chr, entry
and substitute
functions DO NOT provide this support in Progress. Each of the
corresponding backing methods properly duplicate this behavior.
This class implements unknown value logic for all operators and functions. Generally, if any parameter of the these methods is unknown, the result is unknown.
Constructor and Description |
---|
TextOps() |
Modifier and Type | Method and Description |
---|---|
static boolean |
_begins(java.lang.String op1,
character op2)
Tests if the first operand begins with the second operand, implementing
a case-sensitive comparison if the right operand is case-sensitive.
|
static boolean |
_begins(java.lang.String op1,
java.lang.String op2)
Tests if the first operand begins with the second operand, ignoring the case of the two
operands.
|
static boolean |
_begins(java.lang.String op1,
java.lang.String op2,
boolean caseSens)
Tests if the first operand begins with the second operand, honoring the case sensitivity
preference of the caller.
|
static boolean |
_begins(Text op1,
character op2)
Tests if the first operand begins with the second operand, implementing
a case-sensitive comparison if either of the two operands is case-sensitive.
|
static boolean |
_begins(Text op1,
java.lang.String op2)
Tests if the first operand begins with the second operand, implementing a case-sensitive
comparison if the left operand is case-sensitive.
|
static boolean |
_matches(java.lang.String op,
character pattern,
boolean windows)
Tests if the first operand matches a regular expression that is provided by the caller,
case-insensitively.
|
static boolean |
_matches(java.lang.String op,
java.lang.String pattern)
Tests if the first operand matches a regular expression that is provided by the caller,
ignoring the case of the operand and the pattern.
|
static boolean |
_matches(java.lang.String op,
java.lang.String pattern,
boolean caseSens,
boolean windows)
Tests if the first operand matches a regular expression that is provided by the caller,
honoring the case sensitivity preference of the caller.
|
static boolean |
_matches(Text op,
character pattern,
boolean windows)
Tests if the first operand matches a regular expression that is provided by the caller,
basing case sensitivity on the left operand.
|
static boolean |
_matches(Text op,
java.lang.String pattern)
Tests if the first operand matches a regular expression that is provided by the caller,
basing case sensitivity on the left operand.
|
static logical |
begins(java.lang.String op1,
character op2)
Tests if the first operand begins with the second operand, implementing a case-sensitive
comparison if the right operand is case-sensitive.
|
static logical |
begins(java.lang.String op1,
java.lang.String op2)
Tests if the first operand begins with the second operand, ignoring the
case of the two operands.
|
static logical |
begins(java.lang.String op1,
java.lang.String op2,
boolean caseSens)
Tests if the first operand begins with the second operand, honoring the
case sensitivity preference of the caller.
|
static logical |
begins(Text op1,
character op2)
Tests if the first operand begins with the second operand, implementing
a case-sensitive comparison if either of the two operands is
case-sensitive.
|
static logical |
begins(Text op1,
java.lang.String op2)
Tests if the first operand begins with the second operand, implementing a case-sensitive
comparison if the left operand is case-sensitive.
|
static integer |
byteLength(java.lang.String s)
Returns the length of the given
character literal in bytes. |
static integer |
byteLength(Text c)
Returns the length of the given
character or
longchar instance in bytes. |
static int |
byteLengthOf(Text c)
Returns the length of the given
character or
longchar instance in bytes. |
static <T extends Text> |
codePageConvert(T text)
Convert the given text from one code page to another.
|
static <T extends Text> |
codePageConvert(T text,
character target)
Convert the given text using the specified codepage.
|
static <T extends Text> |
codePageConvert(T text,
character target,
character source)
Convert the given text using the specified codepage, assuming the text
is encoded with the given source codepage.
|
static <T extends Text> |
codePageConvert(T text,
character target,
java.lang.String source)
Convert the given text using the specified codepage, assuming the text
is encoded with the given source codepage.
|
static <T extends Text> |
codePageConvert(T text,
java.lang.String target)
Convert the given text using the specified codepage.
|
static <T extends Text> |
codePageConvert(T text,
java.lang.String target,
character source)
Convert the given text using the specified codepage, assuming the text
is encoded with the given source codepage.
|
static <T extends Text> |
codePageConvert(T text,
java.lang.String target,
java.lang.String source)
Convert the given text using the specified codepage, assuming the text
is encoded with the given source codepage.
|
static logical |
compare(Text op1,
character operator,
Text op2,
character strength)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
character operator,
Text op2,
character strength,
character collation)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
character operator,
Text op2,
character strength,
java.lang.String collation)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
character operator,
Text op2,
java.lang.String strength)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
character operator,
Text op2,
java.lang.String strength,
character collation)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
character operator,
Text op2,
java.lang.String strength,
java.lang.String collation)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
int operator,
Text op2,
int strength)
Compares two character values with a runtime-specified strength and
operator.
|
static logical |
compare(Text op1,
int operator,
Text op2,
int strength,
java.lang.String collation)
Compares two character values with a runtime-specified strength and
operator.
|
static logical |
compare(Text op1,
java.lang.String operator,
Text op2,
character strength)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
java.lang.String operator,
Text op2,
character strength,
character collation)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
java.lang.String operator,
Text op2,
character strength,
java.lang.String collation)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
java.lang.String operator,
Text op2,
java.lang.String strength)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
java.lang.String operator,
Text op2,
java.lang.String strength,
character collation)
Compare the two texts using the given operator and the given text.
|
static logical |
compare(Text op1,
java.lang.String operator,
Text op2,
java.lang.String strength,
java.lang.String collation)
Compare the two texts using the given operator and the given text.
|
static character |
concat(java.lang.Object... list)
Implements the
+ concatenation operator. |
static character |
entry(double i,
java.lang.String list)
Returns the specified 1-based indexed comma-delimited entry in the
passed list.
|
static character |
entry(double i,
java.lang.String list,
char delimit)
Returns the specified 1-based indexed entry in the passed list.
|
static character |
entry(double i,
java.lang.String list,
java.lang.String delimit)
Returns the specified 1-based indexed entry in the passed list.
|
static <T extends Text> |
entry(double i,
T list)
Returns the specified 1-based indexed comma-delimited entry in the
passed list.
|
static <T extends Text> |
entry(double i,
T list,
character delimit)
Returns the specified 1-based indexed entry in the passed list.
|
static <T extends Text> |
entry(double i,
T list,
java.lang.String delimit)
Returns the specified 1-based indexed entry in the passed list.
|
static character |
entry(NumberType i,
java.lang.String list)
Returns the specified 1-based indexed comma-delimited entry in the
passed list.
|
static character |
entry(NumberType i,
java.lang.String list,
character delimit)
Returns the specified 1-based indexed entry in the passed list.
|
static character |
entry(NumberType i,
java.lang.String list,
java.lang.String delimit)
Returns the specified 1-based indexed entry in the passed list.
|
static <T extends Text> |
entry(NumberType i,
T list)
Returns the specified 1-based indexed comma-delimited entry in the
passed list.
|
static <T extends Text> |
entry(NumberType i,
T list,
character delimit)
Returns the specified 1-based indexed entry in the passed list.
|
static <T extends Text> |
entry(NumberType i,
T list,
java.lang.String delimit)
Returns the specified 1-based indexed entry in the passed list.
|
private static <T extends Text> |
entryImpl(java.lang.Class<T> cls,
double ii,
java.lang.String list,
char delimit)
Returns the specified 1-based indexed entry in the passed list.
|
(package private) static java.lang.String |
fixupRegexChar(char ch)
Converts a single character into a regular expression, including
escaping any of the special characters that have other meaning in
regular expressions.
|
(package private) static void |
fixupRegexChar(char ch,
java.lang.StringBuilder regex)
Converts a single character into a regular expression in the given string builder,
including escaping any of the special characters that have other meaning in regular
expressions.
|
(package private) static void |
genNegativeIndexError()
Generate an error for a substring or overlay index that is negative.
|
(package private) static void |
genOutsideRangeError(int idx,
java.lang.String list)
Generate an error for a value out of range.
|
private static int |
getCompareOperator(character compare)
Convert the compare operator's string representation to its numeric
representation, to be used by the
compare(Text, int, Text, int)
method. |
private static int |
getStrength(character strength)
Convert the strength's string representation to its numeric
representation, to be used by the
compare(Text, int, Text, int)
method. |
static integer |
indexOf(java.lang.String src,
java.lang.String target)
Returns the 1-based index of one character expression within another
given character expression.
|
static integer |
indexOf(java.lang.String src,
java.lang.String target,
double ii)
Returns the 1-based index of one character expression within another
given character expression based on a known starting point for the
search.
|
static integer |
indexOf(java.lang.String src,
java.lang.String target,
double ii,
boolean caseSensitive)
Returns the 1-based index of one character expression within another
given character expression based on a known starting point for the
search.
|
static integer |
indexOf(java.lang.String src,
java.lang.String target,
NumberType i)
Returns the 1-based index of one character expression within another
given character expression based on a known starting point for the
search.
|
static integer |
indexOf(java.lang.String src,
Text target)
Returns the 1-based index of one character expression within another
given character expression.
|
static integer |
indexOf(java.lang.String src,
Text target,
double i)
Returns the 1-based index of one character expression within another
given character expression based on a known starting point for the
search.
|
static integer |
indexOf(java.lang.String src,
Text target,
NumberType i)
Returns the 1-based index of one character expression within another
given character expression based on a known starting point for the
search.
|
static integer |
indexOf(Text src,
java.lang.String target)
Returns the 1-based index of one character expression within another
given character expression.
|
static integer |
indexOf(Text src,
java.lang.String target,
double i)
Returns the 1-based index of one character expression within another
given character expression based on a known starting point for the
search.
|
static integer |
indexOf(Text src,
java.lang.String target,
NumberType i)
Returns the 1-based index of one character expression within another
given character expression based on a known starting point for the
search.
|
static integer |
indexOf(Text src,
Text target)
Returns the 1-based index of one character expression within another
given character expression.
|
static integer |
indexOf(Text src,
Text target,
double i)
Returns the 1-based index of one character expression within another
given character expression based on a known starting point for the
search.
|
static integer |
indexOf(Text src,
Text target,
NumberType i)
Returns the 1-based index of one character expression within another
given character expression based on a known starting point for the
search.
|
private static <T extends Text> |
instantiate(java.lang.Class<T> cls,
java.lang.String val)
Create a new instance of the given
Text subclass and set its
value. |
private static <T extends Text> |
instantiateUnknown(java.lang.Class<T> cls)
Create a new instance of the given
Text subclass and set it to
unknown. |
static integer |
lastIndexOf(java.lang.String src,
java.lang.String target)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning).
|
static integer |
lastIndexOf(java.lang.String src,
java.lang.String target,
double ii)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning) starting at a specified
starting index.
|
static integer |
lastIndexOf(java.lang.String src,
java.lang.String target,
NumberType i)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning) starting at a specified
starting index.
|
static integer |
lastIndexOf(java.lang.String src,
Text target)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning).
|
static integer |
lastIndexOf(java.lang.String src,
Text target,
double i)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning) starting at a specified
starting index.
|
static integer |
lastIndexOf(java.lang.String src,
Text target,
NumberType i)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning) starting at a specified
starting index.
|
static integer |
lastIndexOf(Text src,
java.lang.String target)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning).
|
static integer |
lastIndexOf(Text src,
java.lang.String target,
double i)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning) starting at a specified
starting index.
|
static integer |
lastIndexOf(Text src,
java.lang.String target,
NumberType i)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning) starting at a specified
starting index.
|
static integer |
lastIndexOf(Text src,
Text target)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning).
|
static integer |
lastIndexOf(Text src,
Text target,
double i)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning) starting at a specified
starting index.
|
static integer |
lastIndexOf(Text src,
Text target,
NumberType i)
Returns the last 1-based index of one character expression within
another given character expression (the search starts at the end
of the string and moves toward the beginning) starting at a specified
starting index.
|
static character |
leftTrim(java.lang.String input)
Trims any contiguous space, tab, line feed and carriage return from the
left of an input string.
|
static character |
leftTrim(java.lang.String input,
character list)
Trims the list of contiguous trim characters from the left of an input
string.
|
static character |
leftTrim(java.lang.String input,
java.lang.String list)
Trims the list of contiguous trim characters from the left of an input
string.
|
static character |
leftTrim(java.lang.String input,
java.lang.String list,
boolean caseSens)
Trims the list of contiguous trim characters from the left of an input
string.
|
static <T extends Text> |
leftTrim(T input)
Trims any contiguous space, tab, line feed and carriage return from the
left of an input string.
|
static <T extends Text> |
leftTrim(T input,
character list)
Trims the list of contiguous trim characters from the left of an input
string.
|
static <T extends Text> |
leftTrim(T input,
java.lang.String list)
Trims the list of contiguous trim characters from the left of an input
string.
|
private static <T extends Text> |
leftTrimImpl(java.lang.Class<T> cls,
java.lang.String input,
java.lang.String list,
boolean caseSens)
Trims the list of contiguous trim characters from the left of an input
string.
|
static integer |
length(java.lang.String c)
Returns the length of the given string instance in characters.
|
static integer |
length(java.lang.String c,
character type)
Returns the length of the given
character instance, using the type parameter
to determine the measurement. |
private static integer |
length(java.lang.String c,
java.lang.String type)
Returns the length of the given
character instance, using the type parameter
to determine the measurement. |
static integer |
length(Text c)
Returns the length of the given
character instance in
characters. |
static integer |
length(Text c,
character type)
Returns the length of the given
character instance, using the type parameter
to determine the measurement. |
static integer |
length(Text c,
java.lang.String type)
Returns the length of the given
character instance, using the type parameter
to determine the measurement. |
static int |
lengthOf(Text c)
Returns the length of the given
character instance in
characters. |
static integer |
lookup(character c,
java.lang.String list)
Returns the 1-based index of a specified entry in the passed
comma-delimited list.
|
static integer |
lookup(character c,
java.lang.String list,
character delim)
Returns the 1-based index of a specified entry in the passed
list with a user-specified delimiter.
|
static integer |
lookup(character c,
java.lang.String list,
java.lang.String delim)
Returns the 1-based index of a specified entry in the passed
list with a user-specified delimiter.
|
static integer |
lookup(character c,
Text list)
Returns the 1-based index of a specified entry in the passed
comma-delimited list.
|
static integer |
lookup(character c,
Text list,
character delim)
Returns the 1-based index of a specified entry in the passed
list with a user-specified delimiter.
|
static integer |
lookup(character c,
Text list,
java.lang.String delim)
Returns the 1-based index of a specified entry in the passed
list with a user-specified delimiter.
|
static integer |
lookup(java.lang.String c,
java.lang.String list)
Returns the 1-based index of a specified entry in the passed
comma-delimited list.
|
static integer |
lookup(java.lang.String c,
java.lang.String list,
char delim)
Returns the 1-based index of a specified entry in the passed
list with a user-specified delimiter.
|
static integer |
lookup(java.lang.String c,
java.lang.String list,
character delim)
Returns the 1-based index of a specified entry in the passed
list with a user-specified delimiter.
|
static integer |
lookup(java.lang.String c,
java.lang.String list,
char delim,
boolean cs)
Returns the 1-based index of a specified entry in the passed
list with a user-specified delimiter.
|
static integer |
lookup(java.lang.String c,
java.lang.String list,
java.lang.String delim)
Returns the 1-based index of a specified entry in the passed
list with a user-specified delimiter.
|
static integer |
lookup(java.lang.String c,
Text list)
Returns the 1-based index of a specified entry in the passed
comma-delimited list.
|
static integer |
lookup(java.lang.String c,
Text list,
character delim)
Returns the 1-based index of a specified entry in the passed
list with a user-specified delimiter.
|
static integer |
lookup(java.lang.String c,
Text list,
java.lang.String delim)
Returns the 1-based index of a specified entry in the passed
list with a user-specified delimiter.
|
static logical |
matches(java.lang.String op,
character pattern,
boolean windows)
Tests if the first operand matches a regular expression that is provided by the caller,
case-insensitively.
|
static logical |
matches(java.lang.String op,
java.lang.String regExp)
Tests if the first operand matches a regular expression that is provided by the caller.
|
static logical |
matches(java.lang.String op,
java.lang.String pattern,
boolean windows)
Tests if the first operand matches a regular expression that is provided by the caller,
ignoring the case of the operand and the pattern.
|
static logical |
matches(java.lang.String op,
java.lang.String pattern,
boolean caseSens,
boolean windows)
Tests if the first operand matches a regular expression that is provided by the caller,
honoring the case sensitivity preference of the caller.
|
static logical |
matches(Text op,
character pattern,
boolean windows)
Tests if the first operand matches a regular expression that is provided by the caller,
basing case sensitivity on the left operand.
|
static logical |
matches(Text op,
java.lang.String regExp)
Tests if the first operand matches a regular expression that is provided by the caller.
|
static logical |
matches(Text op,
java.lang.String pattern,
boolean windows)
Tests if the first operand matches a regular expression that is provided by the caller,
basing case sensitivity on the left operand.
|
static logical |
matchesList(java.lang.String list)
Tests if the current PROGRESS user is allowed in the list.
|
static logical |
matchesList(java.lang.String list,
character item)
Tests if a string specified with the "item" parameter is allowed in the
comma-separated list of allowed items.
|
static logical |
matchesList(java.lang.String list,
java.lang.String item)
Tests if a string specified with the "item" parameter is allowed in the
comma-separated list of allowed items.
|
static logical |
matchesList(Text list)
Tests if the current PROGRESS user is allowed in the list.
|
static logical |
matchesList(Text list,
character item)
Tests if a string specified with the "item" parameter is allowed in the
comma-separated list of allowed items.
|
static logical |
matchesList(Text list,
java.lang.String item)
Tests if a string specified with the "item" parameter is allowed in the
comma-separated list of allowed items.
|
static <T extends Text> |
maximum(T... list)
Returns the largest instance (lexicographically) from the list.
|
static <T extends Text> |
minimum(T... list)
Returns the smallest instance (lexicographically) from the list.
|
static <T extends Text> |
normalize(T text,
character format)
Get the normalized form of the given string, based on the specified
Unicode normalization form:
The
format parameter must evaluate to one of the following
strings:
NFD - Canonical Decomposition
NFC - Canonical Decomposition, followed by Canonical Composition
NFKD - Compatibility Decomposition
NFKC - Compatibility Decomposition, followed by Canonical Composition
NONE - Returns the source string unchanged
|
static <T extends Text> |
normalize(T text,
java.lang.String format)
Get the normalized form of the given string, based on the specified
Unicode normalization form:
The
format parameter must evaluate to one of the following
strings:
NFD - Canonical Decomposition
NFC - Canonical Decomposition, followed by Canonical Composition
NFKD - Compatibility Decomposition
NFKC - Compatibility Decomposition, followed by Canonical Composition
NONE - Returns the source string unchanged
|
static integer |
numEntries(java.lang.String list)
Returns the number of comma-delimited entries in the passed list.
|
static integer |
numEntries(java.lang.String list,
char delimit)
Returns the number of entries in the passed list.
|
static integer |
numEntries(java.lang.String list,
character delimit)
Returns the number of entries in the passed list.
|
static integer |
numEntries(java.lang.String list,
java.lang.String delimit)
Returns the number of entries in the passed list.
|
static integer |
numEntries(Text list)
Returns the number of comma-delimited entries in the passed list.
|
static integer |
numEntries(Text list,
character delimit)
Returns the number of entries in the passed list.
|
static integer |
numEntries(Text list,
java.lang.String delimit)
Returns the number of entries in the passed list.
|
static int |
numEntriesOf(java.lang.String list)
Returns the number of comma-delimited entries in the passed list.
|
static int |
numEntriesOf(java.lang.String list,
char delimit)
Returns the number of entries in the passed list.
|
static int |
numEntriesOf(Text list)
Returns the number of comma-delimited entries in the passed list.
|
static int |
numEntriesOf(Text list,
character delimit)
Returns the number of entries in the passed list.
|
static character |
replaceAll(java.lang.String src,
java.lang.String from,
java.lang.String to)
Searches for all matches to the
from string in the
src string and replaces these with the to
string. |
static character |
replaceAll(java.lang.String src,
java.lang.String from,
java.lang.String to,
boolean cs)
Searches for all matches to the
from string in the
src string and replaces these with the to
string. |
static character |
replaceAll(java.lang.String src,
java.lang.String from,
Text to)
Searches for all matches to the
from string in the
src string and replaces these with the to
string. |
static character |
replaceAll(java.lang.String src,
Text from,
java.lang.String to)
Searches for all matches to the
from string in the
src string and replaces these with the to
string. |
static character |
replaceAll(java.lang.String src,
Text from,
Text to)
Searches for all matches to the
from string in the
src string and replaces these with the to
string. |
static <T extends Text> |
replaceAll(T src,
java.lang.String from,
java.lang.String to)
Searches for all matches to the
from string in the
src string and replaces these with the to
string. |
static <T extends Text> |
replaceAll(T src,
java.lang.String from,
Text to)
Searches for all matches to the
from string in the
src string and replaces these with the to
string. |
static <T extends Text> |
replaceAll(T src,
Text from,
java.lang.String to)
Searches for all matches to the
from string in the
src string and replaces these with the to
string. |
static <T extends Text> |
replaceAll(T src,
Text from,
Text to)
Searches for all matches to the
from string in the
src string and replaces these with the to
string. |
private static <T extends Text> |
replaceAllImpl(java.lang.Class<T> cls,
java.lang.String src,
java.lang.String from,
java.lang.String to,
boolean cs)
Searches for all matches to the
from string in the
src string and replaces these with the to
string. |
static character |
rightTrim(java.lang.String input)
Trims any contiguous space, tab, line feed and carriage return from the
right of an input string.
|
static character |
rightTrim(java.lang.String input,
character list)
Trims the list of contiguous trim characters from the right of an input
string.
|
static character |
rightTrim(java.lang.String input,
java.lang.String list)
Trims the list of contiguous trim characters from the right of an input
string.
|
static character |
rightTrim(java.lang.String input,
java.lang.String list,
boolean caseSens)
Trims the list of contiguous trim characters from the right of an input
string.
|
static <T extends Text> |
rightTrim(T input)
Trims any contiguous space, tab, line feed and carriage return from the
right of an input string.
|
static <T extends Text> |
rightTrim(T input,
character list)
Trims the list of contiguous trim characters from the right of an input
string.
|
static <T extends Text> |
rightTrim(T input,
java.lang.String list)
Trims the list of contiguous trim characters from the right of an input
string.
|
private static <T extends Text> |
rightTrimImpl(java.lang.Class<T> cls,
java.lang.String input,
java.lang.String list,
boolean caseSens)
Trims the list of contiguous trim characters from the right of an input
string.
|
(package private) static char |
safeDelimiter(java.lang.String delimiter)
Given a delimiter string, extract the first character and retrun it.
|
static character |
substitute(java.lang.String fmt,
java.lang.Object... replacements)
Perform positional replacement of '&n' specifiers in the format string
fmt , using the array of character and/or
String objects as the list of replacements. |
static <T extends Text> |
substitute(T fmt,
java.lang.Object... replacements)
Perform positional replacement of '&n' specifiers in the format string
fmt , using the array of character and/or
String objects as the list of replacements. |
private static <T extends Text> |
substituteImpl(java.lang.Class<T> cls,
java.lang.String fmt,
java.lang.Object... replacements)
Perform positional replacement of '&n' specifiers in the format string
fmt , using the array of character and/or
String objects as the list of replacements. |
static character |
substring(java.lang.String src,
int pos)
Returns the substring of the string at the given 1-based index and
extending for the rest of the string.
|
static character |
substring(java.lang.String src,
int pos,
int len)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static character |
substring(java.lang.String src,
int pos,
int len,
java.lang.String type)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static character |
substring(java.lang.String src,
int pos,
int len,
java.lang.String type,
boolean caseSens)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static character |
substring(java.lang.String src,
int pos,
NumberType len)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static character |
substring(java.lang.String src,
NumberType pos)
Returns the substring of the string at the given 1-based index and
extending for the rest of the string.
|
static character |
substring(java.lang.String src,
NumberType pos,
int len)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static character |
substring(java.lang.String src,
NumberType pos,
NumberType len)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
int pos)
Returns the substring of the string at the given 1-based index and
extending for the rest of the string.
|
static <T extends Text> |
substring(T src,
int pos,
int len)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
int pos,
int len,
character type)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
int pos,
int len,
java.lang.String type)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
int pos,
NumberType len)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
int pos,
NumberType len,
character type)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
int pos,
NumberType len,
java.lang.String type)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
NumberType pos)
Returns the substring of the string at the given 1-based index and
extending for the rest of the string.
|
static <T extends Text> |
substring(T src,
NumberType pos,
int len)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
NumberType pos,
int len,
character type)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
NumberType pos,
int len,
java.lang.String type)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
NumberType pos,
NumberType len)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
NumberType pos,
NumberType len,
character type)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static <T extends Text> |
substring(T src,
NumberType pos,
NumberType len,
java.lang.String type)
Returns the substring of the string at the given 1-based index and
of the given length.
|
private static <T extends Text> |
substringImpl(java.lang.Class<T> cls,
java.lang.String src,
int pos,
int len,
java.lang.String type,
boolean caseSens)
Returns the substring of the string at the given 1-based index and
of the given length.
|
static character |
toLowerCase(java.lang.String str)
Returns a character instance that contains the lowercased version of
the specified string.
|
static <T extends Text> |
toLowerCase(T c)
Returns a character instance that contains the lowercased version of
the specified string.
|
private static <T extends Text> |
toLowerCaseImpl(java.lang.Class<T> cls,
java.lang.String str)
Returns a character instance that contains the lowercased version of
the specified string.
|
static character |
toUpperCase(java.lang.String str)
Returns a character instance that contains the uppercased version of
the specified string.
|
static java.lang.String |
toUpperCase(java.lang.String str,
boolean runtimeString)
Returns a string instance that contains the uppercased version of
the specified string.
|
static <T extends Text> |
toUpperCase(T c)
Returns a character instance that contains the uppercased version of
the specified string.
|
private static <T extends Text> |
toUpperCaseImpl(java.lang.Class<T> cls,
java.lang.String str)
Returns a character instance that contains the uppercased version of the specified string.
|
static character |
trim(java.lang.String input)
Trims any contiguous space, tab, line feed and carriage return from the
left and right of an input string.
|
static character |
trim(java.lang.String input,
character list)
Trims the list of contiguous trim characters from the left and right
of an input string.
|
static character |
trim(java.lang.String input,
java.lang.String list)
Trims the list of contiguous trim characters from the left and right
of an input string.
|
static character |
trim(java.lang.String input,
java.lang.String list,
boolean caseSens)
Trims the list of contiguous trim characters from the left and right
of an input string.
|
static java.lang.String |
trim(java.lang.String input,
java.lang.String list,
boolean left,
boolean caseSens)
Trims the list of contiguous trim characters from the left or right of an input string.
|
static <T extends Text> |
trim(T input)
Trims any contiguous space, tab, line feed and carriage return from the
left and right of an input string.
|
static <T extends Text> |
trim(T input,
character list)
Trims the list of contiguous trim characters from the left and right
of an input string.
|
static <T extends Text> |
trim(T input,
java.lang.String list)
Trims the list of contiguous trim characters from the left and right
of an input string.
|
private static <T extends Text> |
trimImpl(java.lang.Class<T> cls,
java.lang.String input,
java.lang.String list,
boolean caseSens)
Trims the list of contiguous trim characters from the left and right of an input string.
|
private static final int LT
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.private static final int LE
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.private static final int GT
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.private static final int GE
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.private static final int EQ
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.private static final int NE
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.private static final int MATCHES
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.private static final int BEGINS
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.private static final int RAW
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
or substring(T, com.goldencode.p2j.util.NumberType, com.goldencode.p2j.util.NumberType, java.lang.String)
.private static final int COLUMN
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
or substring(T, com.goldencode.p2j.util.NumberType, com.goldencode.p2j.util.NumberType, java.lang.String)
.private static final int FIXED
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
or substring(T, com.goldencode.p2j.util.NumberType, com.goldencode.p2j.util.NumberType, java.lang.String)
.private static final int CHARACTER
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
or substring(T, com.goldencode.p2j.util.NumberType, com.goldencode.p2j.util.NumberType, java.lang.String)
.private static final int CASE_SENSITIVE
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.private static final int CASE_INSENSITIVE
compare(com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character, com.goldencode.p2j.util.Text, com.goldencode.p2j.util.character)
.private static final int MAX_CACHED_PATTERNS
private static final java.util.concurrent.atomic.AtomicInteger patternCount
private static final java.util.Map<java.lang.String,java.util.regex.Pattern> patternCache
public static boolean _matches(Text op, character pattern, boolean windows)
The Progress style matching pattern passed as a parameter is converted to a regular
expression using SQLHelper.convertToRegEx(java.lang.String, boolean)
during this method.
op
- String to check for a match.pattern
- Progress style matching pattern.windows
- true
if the backslash does not have special meaning. On Unix, P4GL
the backslash (\)is an escape character, like tilde (\).true
if op matches the regular expression or false
if
there is no match or if either operand is unknown
.public static boolean _matches(Text op, java.lang.String pattern)
This form of the method is unix-escape independent because Progress style matching pattern passed as a parameter is already transformed at conversion time to a regular expression.
op
- String to check for a match.pattern
- RegExp matching pattern transformed from Progress at conversion time.true
if op matches the regular expression or false
if
there is no match or if the left operand is unknown
.public static boolean _matches(java.lang.String op, character pattern, boolean windows)
The Progress style matching pattern passed as a parameter is converted to a regular
expression using SQLHelper.convertToRegEx(java.lang.String, boolean)
during this method.
op
- String to check for a match.pattern
- Progress style matching pattern.windows
- true
if the backslash does not have special meaning. On Unix, P4GL
the backslash (\)is an escape character, like tilde (\).true
if op matches the regular expression or false
if
there is no match or if the right operand is unknown
.public static boolean _matches(java.lang.String op, java.lang.String pattern)
This form of the method is unix-escape independent because Progress style matching pattern passed as a parameter is already transformed at conversion time to a regular expression. By default, in P4GL character operations are case insensitive.
op
- String to check for a match.pattern
- RegExp matching pattern transformed from Progress at conversion time.true
if op matches the regular expression.public static boolean _matches(java.lang.String op, java.lang.String pattern, boolean caseSens, boolean windows)
The Progress style matching pattern passed as a parameter is converted to a regular
expression using SQLHelper.convertToRegEx(java.lang.String, boolean)
during this method.
op
- String to check for a match.pattern
- Progress style matching pattern.caseSens
- true
if a case-sensitive comparison should be used.windows
- true
if the backslash does not have special meaning. On Unix, P4GL
the backslash (\)is an escape character, like tilde (\).true
if op matches the regular expression.public static boolean _begins(Text op1, character op2)
op1
- First string to compare.op2
- Second string to compare.true
if op1 begins with op2 or false
if there is no
match or if either operand is unknown value
.public static boolean _begins(java.lang.String op1, character op2)
op1
- First string to compare.op2
- Second string to compare.true
if op1 begins with op2 or false
if there is no
match or if the right operand is unknown value
.public static boolean _begins(Text op1, java.lang.String op2)
op1
- First string to compare.op2
- Second string to compare.true
if op1 begins with op2 or false
if there is no
match or if the left operand is unknown value
.public static boolean _begins(java.lang.String op1, java.lang.String op2)
op1
- First string to compare.op2
- Second string to compare.true
if op1 begins with op2.public static boolean _begins(java.lang.String op1, java.lang.String op2, boolean caseSens)
op1
- First string to compare.op2
- Second string to compare.caseSens
- true
if a case-sensitive comparison should be used.true
if op1 begins with op2.public static logical begins(Text op1, character op2)
op1
- First string to compare.op2
- Second string to compare.true
if op1 begins with op2 or
unknown value
if either operand is
unknown value
.public static logical begins(java.lang.String op1, character op2)
op1
- First string to compare.op2
- Second string to compare.true
if op1 begins with op2 or unknown value
if the
right operand is unknown value
.public static logical begins(Text op1, java.lang.String op2)
op1
- First string to compare.op2
- Second string to compare.true
if op1 begins with op2 or unknown value
if the left
operand is unknown value
.public static logical begins(java.lang.String op1, java.lang.String op2)
op1
- First string to compare.op2
- Second string to compare.true
if op1 begins with op2.public static logical begins(java.lang.String op1, java.lang.String op2, boolean caseSens)
op1
- First string to compare.op2
- Second string to compare.caseSens
- true
if a case-sensitive comparison should be used.true
if op1 begins with op2.public static int byteLengthOf(Text c)
character
or
longchar
instance in bytes.c
- The instance to test.unknown value
.public static integer byteLength(java.lang.String s)
character
literal in bytes.s
- The literal to test.public static integer byteLength(Text c)
character
or
longchar
instance in bytes.c
- The instance to test.unknown value
if the instance is
unknown value
.public static <T extends Text> T codePageConvert(T text)
text
- The text which needs to be converted.public static <T extends Text> T codePageConvert(T text, java.lang.String target)
text
- The text to be converted.target
- The target codepage.public static <T extends Text> T codePageConvert(T text, java.lang.String target, java.lang.String source)
text
- The text to be converted.target
- The target codepage.source
- The source codepage. If the text is a longchar
instance, then the text's internal codepage is used.public static <T extends Text> T codePageConvert(T text, java.lang.String target, character source)
text
- The text to be converted.target
- The target codepage.source
- The source codepage. If the text is a longchar
instance, then the text's internal codepage is used.public static <T extends Text> T codePageConvert(T text, character target)
text
- The text to be converted.target
- The target codepage.public static <T extends Text> T codePageConvert(T text, character target, java.lang.String source)
text
- The text to be converted.target
- The target codepage.source
- The source codepage. If the text is a longchar
instance, then the text's internal codepage is used.public static <T extends Text> T codePageConvert(T text, character target, character source)
text
- The text to be converted.target
- The target codepage.source
- The source codepage. If the text is a longchar
instance, then the text's internal codepage is used.public static logical compare(Text op1, character operator, Text op2, character strength)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, java.lang.String operator, Text op2, character strength)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, character operator, Text op2, java.lang.String strength)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, java.lang.String operator, Text op2, java.lang.String strength)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, character operator, Text op2, character strength, character collation)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.collation
- The used collation. When null
, the default
collation is used.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, java.lang.String operator, Text op2, character strength, character collation)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.collation
- The used collation. When null
, the default
collation is used.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, character operator, Text op2, java.lang.String strength, character collation)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.collation
- The used collation. When null
, the default
collation is used.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, java.lang.String operator, Text op2, java.lang.String strength, character collation)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.collation
- The used collation. When null
, the default
collation is used.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, character operator, Text op2, character strength, java.lang.String collation)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.collation
- The used collation. When null
, the default
collation is used.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, java.lang.String operator, Text op2, character strength, java.lang.String collation)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.collation
- The used collation. When null
, the default
collation is used.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, character operator, Text op2, java.lang.String strength, java.lang.String collation)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.collation
- The used collation. When null
, the default
collation is used.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, java.lang.String operator, Text op2, java.lang.String strength, java.lang.String collation)
op1
- The first string to be compared.operator
- The operator to be used for this comparison. Must evaluate to
one of the strings presented above.op2
- The second string to be compared.strength
- The used strength. Must evaluate to one of the strings
presented above.collation
- The used collation. When null
, the default
collation is used.logical
value representing the result of the
comparison, depending on the operator and strength used.public static logical compare(Text op1, int operator, Text op2, int strength)
This method does not handle the case of user-specified collation tables as is possible in Progress.
In addition, the case-sensitive and case-insensitive strength options are likely to differ in some results since the current implementation really just implements a direct numeric comparison based on each UNICODE character's value (though case-insensitive support is provided but it just converts everything to the same case before implementing the 'raw' lexicographic comparison.
op1
- The left operand.operator
- One of LT
, LE
,
GT
, GE
,
EQ
or NE
.op2
- The right operand.strength
- One of RAW
, CASE_SENSITIVE
or CASE_INSENSITIVE
.public static logical compare(Text op1, int operator, Text op2, int strength, java.lang.String collation)
This method does not handle the case of user-specified collation tables as is possible in Progress.
In addition, the case-sensitive and case-insensitive strength options are likely to differ in some results since the current implementation really just implements a direct numeric comparison based on each UNICODE character's value (though case-insensitive support is provided but it just converts everything to the same case before implementing the 'raw' lexicographic comparison.
op1
- The left operand.operator
- One of LT
, LE
,
GT
, GE
,
EQ
or NE
.op2
- The right operand.strength
- One of RAW
, CASE_SENSITIVE
or CASE_INSENSITIVE
.collation
- The used collation. When null
, the default
collation is used.public static character concat(java.lang.Object... list)
+
concatenation operator. If any operand is the
unknown value
, the result is unknown value
. If any operand is
case-sensitive, the result will be case-sensitive. character
operands in
the leftmost position will not be truncated at any embedded null
char
but all other character
operands do in fact get silently truncated. This
is how it works in the 4GL! Since there is no known way to get an embedded
null
into a longchar
or into 4GL string literals, no special
null
handling is provided for those types.
It is valid to pass a mixture of BaseDataType
and other object types to this
method. Types that are not character
or longchar
will not affect
the case-sensitivity or unknown status of the result. These other types will have the
result of toString()
inserted into the returned value.
TODO: this should return Text, but for now we let it return character, as this can be used with lots of builtin functions/methods which expect a character parameter, not a Text parameter.
list
- The operands. In the 4GL, only character
, longchar
and string literals are possible types. For this reason, converted code would
not be expected to pass anything else.public static <T extends Text> T entry(NumberType i, T list, character delimit) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static <T extends Text> T entry(double i, T list, character delimit) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static character entry(NumberType i, java.lang.String list, character delimit) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static <T extends Text> T entry(NumberType i, T list, java.lang.String delimit) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static <T extends Text> T entry(double i, T list, java.lang.String delimit) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static character entry(NumberType i, java.lang.String list, java.lang.String delimit) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static <T extends Text> T entry(NumberType i, T list) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static character entry(NumberType i, java.lang.String list) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static <T extends Text> T entry(double i, T list) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static character entry(double i, java.lang.String list) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static character entry(double i, java.lang.String list, java.lang.String delimit) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static character entry(double i, java.lang.String list, char delimit) throws ErrorConditionException
i
- The 1-based index into the list.list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
public static integer indexOf(Text src, Text target, NumberType i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer indexOf(java.lang.String src, Text target, NumberType i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer indexOf(Text src, java.lang.String target, NumberType i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer indexOf(java.lang.String src, java.lang.String target, NumberType i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer indexOf(Text src, Text target, double i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer indexOf(java.lang.String src, Text target, double i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer indexOf(Text src, java.lang.String target, double i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer indexOf(Text src, Text target)
src
- The character expression to search in.target
- The character expression to search for.unknown value
if any input is unknown value
.public static integer indexOf(java.lang.String src, Text target)
src
- The character expression to search in.target
- The character expression to search for.unknown value
if any input is unknown value
.public static integer indexOf(Text src, java.lang.String target)
src
- The character expression to search in.target
- The character expression to search for.unknown value
if any input is unknown value
.public static integer indexOf(java.lang.String src, java.lang.String target, double ii)
src
- The character expression to search in.target
- The character expression to search for.ii
- The (1-based) starting index from which to search.public static integer indexOf(java.lang.String src, java.lang.String target)
src
- The character expression to search in.target
- The character expression to search for.public static integer indexOf(java.lang.String src, java.lang.String target, double ii, boolean caseSensitive)
src
- The character expression to search in.target
- The character expression to search for.ii
- The (1-based) starting index from which to search.caseSensitive
- true
if case must be considered in the search;
false
if the search is case insensitive.public static integer lastIndexOf(Text src, Text target, NumberType i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer lastIndexOf(java.lang.String src, Text target, NumberType i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer lastIndexOf(Text src, java.lang.String target, NumberType i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer lastIndexOf(java.lang.String src, java.lang.String target, NumberType i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer lastIndexOf(Text src, Text target, double i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer lastIndexOf(java.lang.String src, Text target, double i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer lastIndexOf(Text src, java.lang.String target, double i)
src
- The character expression to search in.target
- The character expression to search for.i
- The starting index to search from.unknown value
if any input is unknown value
.public static integer lastIndexOf(Text src, Text target)
src
- The character expression to search in.target
- The character expression to search for.unknown value
if any input is unknown value
.public static integer lastIndexOf(java.lang.String src, Text target)
src
- The character expression to search in.target
- The character expression to search for.unknown value
if any input is unknown value
.public static integer lastIndexOf(Text src, java.lang.String target)
src
- The character expression to search in.target
- The character expression to search for.unknown value
if any input is unknown value
.public static integer lastIndexOf(java.lang.String src, java.lang.String target, double ii)
src
- The character expression to search in.target
- The character expression to search for.ii
- The starting index to search from.public static integer lastIndexOf(java.lang.String src, java.lang.String target)
src
- The character expression to search in.target
- The character expression to search for.public static <T extends Text> T leftTrim(T input, character list)
Trim operations are performed based on the case-sensitivity of only the input parameter, the trim character list case-sensitivity is ignored. Likewise, if the input parameter is case-sensitive, then the returned instance will be case-sensitive.
input
- The string to trim.list
- The list of characters to trim.public static <T extends Text> T leftTrim(T input, java.lang.String list)
Trim operations are performed based on the case-sensitivity of the the input parameter. If the input parameter is case-sensitive, then the returned instance will be case-sensitive.
input
- The string to trim.list
- The list of characters to trim.public static character leftTrim(java.lang.String input, character list)
Trim operations are performed case-insensitively.
input
- The string to trim.list
- The list of characters to trim.public static <T extends Text> T leftTrim(T input)
Trim operations are performed based on the case-sensitivity of the input parameter. Likewise, if the input parameter is case-sensitive, then the returned instance will be case-sensitive.
input
- The string to trim.public static character leftTrim(java.lang.String input, java.lang.String list, boolean caseSens)
null
the method defaults to space, tab, line feed and carriage return.input
- The string to trim.list
- The list of characters to trim or null
to
use the default list.caseSens
- Specifies the case-sensitivity of the trim operation AND of
the returned instance.public static character leftTrim(java.lang.String input, java.lang.String list)
null
the method defaults to space, tab, line feed and carriage return.
Trim operations and the returned instance will be case-insensitive.
input
- The string to trim.list
- The list of characters to trim or null
to
use the default list.public static character leftTrim(java.lang.String input)
Trim operations and the returned instance will be case-insensitive.
input
- The string to trim.public static int lengthOf(Text c)
character
instance in
characters.c
- The instance to test.unknown value
.public static integer length(Text c)
character
instance in
characters.c
- The instance to test.unknown value
if the instance is
unknown value
.public static integer length(Text c, character type)
character
instance, using the type parameter
to determine the measurement.c
- The instance to test.type
- The measurement mode.
"character" is supposed to be the default measurement unit
for the LENGTH built-in function (when type is null)public static integer length(Text c, java.lang.String type)
character
instance, using the type parameter
to determine the measurement.c
- The instance to test.type
- The measurement mode.
"character" is supposed to be the default measurement unit
for the LENGTH built-in function (when type is null)public static integer length(java.lang.String c, character type)
character
instance, using the type parameter
to determine the measurement.c
- The instance to test.type
- The measurement mode.
"character" is supposed to be the default measurement unit
for the LENGTH built-in function (when type is null)public static integer length(java.lang.String c)
c
- The instance to test.public static integer lookup(character c, Text list, character delim)
c
- The entry to find in the list.list
- The delimited list of entries.delim
- The delimiter character used to parse the list into entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(character c, java.lang.String list, character delim)
c
- The entry to find in the list.list
- The delimited list of entries.delim
- The delimiter character used to parse the list into entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(java.lang.String c, Text list, character delim)
c
- The entry to find in the list.list
- The delimited list of entries.delim
- The delimiter character used to parse the list into entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(character c, Text list, java.lang.String delim)
c
- The entry to find in the list.list
- The delimited list of entries.delim
- The delimiter character used to parse the list into entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(character c, Text list)
c
- The entry to find in the list.list
- The delimited list of entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(character c, java.lang.String list)
c
- The entry to find in the list.list
- The delimited list of entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(java.lang.String c, Text list)
c
- The entry to find in the list.list
- The delimited list of entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(java.lang.String c, java.lang.String list, char delim)
c
- The entry to find in the list.list
- The delimited list of entries.delim
- The delimiter character used to parse the list into entries.public static integer lookup(java.lang.String c, java.lang.String list, char delim, boolean cs)
c
- The entry to find in the list.list
- The delimited list of entries.delim
- The delimiter character used to parse the list into entries.cs
- true
specifies the match is to be done with
case-sensitivity.public static integer lookup(java.lang.String c, java.lang.String list)
c
- The entry to find in the list.list
- The delimited list of entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(java.lang.String c, java.lang.String list, java.lang.String delim)
c
- The entry to find in the list.list
- The delimited list of entries.delim
- The delimiter character used to parse the list into entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(java.lang.String c, Text list, java.lang.String delim)
c
- The entry to find in the list.list
- The delimited list of entries.delim
- The delimiter character used to parse the list into entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(character c, java.lang.String list, java.lang.String delim)
c
- The entry to find in the list.list
- The delimited list of entries.delim
- The delimiter character used to parse the list into entries.unknown value
if any of the inputs are
unknown value
.public static integer lookup(java.lang.String c, java.lang.String list, character delim)
c
- The entry to find in the list.list
- The delimited list of entries.delim
- The delimiter character used to parse the list into entries.unknown value
if any of the inputs are
unknown value
.public static logical matches(Text op, character pattern, boolean windows)
The Progress style matching pattern passed as a parameter is converted to a regular
expression using SQLHelper.convertToRegEx(java.lang.String, boolean)
during this method.
op
- String to check for a match.pattern
- Progress style matching pattern.windows
- true
if the backslash does not have special meaning. On Unix, P4GL
the backslash (\)is an escape character, like tilde (\).true
if op matches the regular expression or unknown
value if either operand is unknown
.public static logical matches(Text op, java.lang.String pattern, boolean windows)
The Progress style matching pattern passed as a parameter is converted to a regular
expression using SQLHelper.convertToRegEx(java.lang.String, boolean)
during this method.
op
- String to check for a match.pattern
- Progress style matching pattern.windows
- true
if the backslash does not have special meaning. On Unix, P4GL
the backslash (\)is an escape character, like tilde (\).true
if op matches the regular expression or unknown
value if the left operand is unknown
.public static logical matches(java.lang.String op, character pattern, boolean windows)
The Progress style matching pattern passed as a parameter is converted to a regular
expression using SQLHelper.convertToRegEx(java.lang.String, boolean)
during this method.
op
- String to check for a match.pattern
- Progress style matching pattern.windows
- true
if the backslash does not have special meaning. On Unix, P4GL
the backslash (\)is an escape character, like tilde (\).true
if op matches the regular expression or unknown
value if the right operand is unknown
.public static logical matches(java.lang.String op, java.lang.String pattern, boolean windows)
The Progress style matching pattern passed as a parameter is converted to a regular
expression using SQLHelper.convertToRegEx(java.lang.String, boolean)
during this method.
op
- String to check for a match.pattern
- Progress style matching pattern.windows
- true
if the backslash does not have special meaning. On Unix, P4GL
the backslash (\)is an escape character, like tilde (\).true
if op matches the regular expression.public static logical matches(java.lang.String op, java.lang.String pattern, boolean caseSens, boolean windows)
The Progress style matching pattern passed as a parameter is converted to a regular
expression using SQLHelper.convertToRegEx(java.lang.String, boolean)
during this method.
op
- String to check for a match.pattern
- Progress style matching pattern.caseSens
- true
if a case-sensitive comparison should be used.windows
- true
if the backslash does not have special meaning. On Unix, P4GL
the backslash (\)is an escape character, like tilde (\).true
if op matches the regular expression.public static logical matches(java.lang.String op, java.lang.String regExp)
This form of the method is unix-escape independent because Progress style matching pattern passed as a parameter is already transformed at conversion time to a regular expression. By default, in P4GL character operations are case insensitive.
op
- String to check for a match.regExp
- The RegExp pattern as obtained using SQLHelper.convertToRegEx(java.lang.String, boolean)
from a
Progress style matching pattern known at conversion time.true
if op matches the regular expression.public static logical matches(Text op, java.lang.String regExp)
This form of the method is unix-escape independent because Progress style matching pattern passed as a parameter is already transformed at conversion time to a regular expression.
op
- String to check for a match.regExp
- The RegExp pattern as obtained using SQLHelper.convertToRegEx(java.lang.String, boolean)
from a
Progress style matching pattern known at conversion time.true
if op matches the regular expression.public static logical matchesList(Text list) throws java.lang.IllegalArgumentException
list
- comma-separated list of user IDs, possibly with ! and *
modifiers.java.lang.IllegalArgumentException
- to catch the untranslated CAN-DO callpublic static logical matchesList(java.lang.String list) throws java.lang.IllegalArgumentException
list
- comma-separated list of user IDs, possibly with ! and *
modifiers.java.lang.IllegalArgumentException
- to catch the untranslated CAN-DO callpublic static logical matchesList(Text list, character item)
list
- comma-separated list of allowed items, possibly with ! and *
modifiers.item
- an item being testedtrue
if item is allowed in the listpublic static logical matchesList(Text list, java.lang.String item)
list
- comma-separated list of allowed items, possibly with ! and *
modifiers.item
- an item being testedtrue
if item is allowed in the listpublic static logical matchesList(java.lang.String list, character item)
list
- comma-separated list of allowed items, possibly with ! and *
modifiers.item
- an item being testedtrue
if item is allowed in the listpublic static logical matchesList(java.lang.String list, java.lang.String item)
list
- comma-separated list of allowed items, possibly with ! and *
modifiers.item
- an item being testedtrue
if item is allowed in the listpublic static <T extends Text> T maximum(T... list)
null
values. Since an instance
is returned which is one of the references that was passed in, the
case-sensitivity of the input will be the same on output.list
- The list of character instances to compare.unknown value
if any
entries in the list are unknown or null
if
an empty list is passed.public static <T extends Text> T minimum(T... list)
null
values. Since an instance
is returned which is one of the references that was passed in, the
case-sensitivity of the input will be the same on output.list
- The list of character instances to compare.unknown value
if any
entries in the list are unknown or null
if
an empty list is passed.public static <T extends Text> T normalize(T text, java.lang.String format)
format
parameter must evaluate to one of the following
strings:
public static <T extends Text> T normalize(T text, character format)
format
parameter must evaluate to one of the following
strings:
public static int numEntriesOf(Text list, character delimit)
list
- The delimited list of entries.delimit
- The delimiter character.unknown value
.public static int numEntriesOf(Text list)
list
- The delimited list of entries.unknown value
.public static int numEntriesOf(java.lang.String list, char delimit)
list
- The delimited list of entries.delimit
- The delimiter character.public static int numEntriesOf(java.lang.String list)
list
- The delimited list of entries.public static integer numEntries(Text list)
list
- The delimited list of entries.unknown value
if
any of the inputs are unknown value
.public static integer numEntries(Text list, java.lang.String delimit)
list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.public static integer numEntries(java.lang.String list, character delimit)
list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.public static integer numEntries(java.lang.String list, java.lang.String delimit)
list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.public static integer numEntries(Text list, character delimit)
list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.public static integer numEntries(java.lang.String list, char delimit)
list
- The delimited list of entries.delimit
- The delimiter character.public static integer numEntries(java.lang.String list)
list
- The delimited list of entries.public static <T extends Text> T replaceAll(T src, Text from, Text to)
from
string in the
src
string and replaces these with the to
string.
The search and the returned instance are case-sensitive if any of the inputs are case-sensitive.
src
- The string to operate upon.from
- The substring to search for.to
- The substring to replace when a match is found.unknown value
if any
input is unknown value
.public static <T extends Text> T replaceAll(T src, Text from, java.lang.String to)
from
string in the
src
string and replaces these with the to
string.
The search and the returned instance are case-sensitive if any of the inputs are case-sensitive.
src
- The string to operate upon.from
- The substring to search for.to
- The substring to replace when a match is found.unknown value
if any
input is unknown value
.public static <T extends Text> T replaceAll(T src, java.lang.String from, Text to)
from
string in the
src
string and replaces these with the to
string.
The search and the returned instance are case-sensitive if any of the inputs are case-sensitive.
src
- The string to operate upon.from
- The substring to search for.to
- The substring to replace when a match is found.unknown value
if any
input is unknown value
.public static character replaceAll(java.lang.String src, Text from, Text to)
from
string in the
src
string and replaces these with the to
string.
The search and the returned instance are case-sensitive if any of the inputs are case-sensitive.
src
- The string to operate upon.from
- The substring to search for.to
- The substring to replace when a match is found.unknown value
if any
input is unknown value
.public static <T extends Text> T replaceAll(T src, java.lang.String from, java.lang.String to)
from
string in the
src
string and replaces these with the to
string.
The search and the returned instance are case-sensitive if the
src
instance is case-sensitive.
src
- The string to operate upon.from
- The substring to search for.to
- The substring to replace when a match is found.unknown value
if the
src
string is unknown value
.public static character replaceAll(java.lang.String src, Text from, java.lang.String to)
from
string in the
src
string and replaces these with the to
string.
The search and the returned instance are case-sensitive if the
from
instance is case-sensitive.
src
- The string to operate upon.from
- The substring to search for.to
- The substring to replace when a match is found.unknown value
if the
from
string is unknown value
.public static character replaceAll(java.lang.String src, java.lang.String from, Text to)
from
string in the
src
string and replaces these with the to
string.
The search and the returned instance are case-sensitive if the
to
instance is case-sensitive.
src
- The string to operate upon.from
- The substring to search for.to
- The substring to replace when a match is found.unknown value
if the
to
string is unknown value
.public static character replaceAll(java.lang.String src, java.lang.String from, java.lang.String to)
from
string in the
src
string and replaces these with the to
string.
The search and the returned instance are always case-insensitive.
src
- The string to operate upon.from
- The substring to search for.to
- The substring to replace when a match is found.unknown value
if the
src
string is unknown value
.public static character replaceAll(java.lang.String src, java.lang.String from, java.lang.String to, boolean cs)
from
string in the
src
string and replaces these with the to
string.src
- The string to operate upon.from
- The substring to search for.to
- The substring to replace when a match is found.cs
- Determines if a case-sensitive match should be performed AND
the case-sensitivity of the returned instance.public static <T extends Text> T rightTrim(T input, character list)
Trim operations are performed based on the case-sensitivity of only the input parameter, the trim character list case-sensitivity is ignored. Likewise, if the input parameter is case-sensitive, then the returned instance will be case-sensitive.
input
- The string to trim.list
- The list of characters to trim.public static <T extends Text> T rightTrim(T input, java.lang.String list)
Trim operations are performed based on the case-sensitivity of the the input parameter. If the input parameter is case-sensitive, then the returned instance will be case-sensitive.
input
- The string to trim.list
- The list of characters to trim.public static <T extends Text> T rightTrim(T input)
Trim operations are performed based on the case-sensitivity of the input parameter. Likewise, if the input parameter is case-sensitive, then the returned instance will be case-sensitive.
input
- The string to trim.public static character rightTrim(java.lang.String input, character list)
Trim operations are performed based case-insensitively.
input
- The string to trim.list
- The list of characters to trim.public static character rightTrim(java.lang.String input, java.lang.String list)
null
the method defaults to space, tab, line feed and carriage return.
Trim operations and the returned instance will be case-insensitive.
input
- The string to trim.list
- The list of characters to trim or null
to
use the default list.public static character rightTrim(java.lang.String input)
Trim operations and the returned instance will be case-insensitive.
input
- The string to trim.public static character rightTrim(java.lang.String input, java.lang.String list, boolean caseSens)
null
the method defaults to space, tab, line feed and carriage return.input
- The string to trim.list
- The list of characters to trim or null
to
use the default list.caseSens
- Specifies the case-sensitivity of the trim operation AND of
the returned instance.public static <T extends Text> T substitute(T fmt, java.lang.Object... replacements) throws ErrorConditionException
fmt
, using the array of character
and/or
String
objects as the list of replacements. The 1-based
index position of the '&n' specifiers (where n and range from 1 to
9) is converted to a 0-based index into the replacements
array. Instances of '&&' yield a single '&' in the result.
Any specifiers that do not correspond to an object in the array are
replaced with an empty string.fmt
- The string specifying the text and format specifiers.replacements
- The list of replacements.unknown value
if the
fmt
string is unknown value
.ErrorConditionException
public static character substitute(java.lang.String fmt, java.lang.Object... replacements) throws ErrorConditionException
fmt
, using the array of character
and/or
String
objects as the list of replacements. The 1-based
index position of the '&n' specifiers (where n and range from 1 to
9) is converted to a 0-based index into the replacements
array. Instances of '&&' yield a single '&' in the result.
Any specifiers that do not correspond to an object in the array are
replaced with an empty string.fmt
- The string specifying the text and format specifiers.replacements
- The list of replacements.ErrorConditionException
public static <T extends Text> T substring(T src, NumberType pos, NumberType len, java.lang.String type)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.unknown value
if any
input is unknown
.public static <T extends Text> T substring(T src, NumberType pos, NumberType len, character type)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.unknown value
if any
input is unknown
.public static <T extends Text> T substring(T src, int pos, NumberType len, java.lang.String type)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.unknown value
if any
input is unknown
.public static <T extends Text> T substring(T src, int pos, NumberType len, character type)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.unknown value
if any
input is unknown
.public static <T extends Text> T substring(T src, NumberType pos, int len, java.lang.String type)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.unknown value
if any
input is unknown
.public static <T extends Text> T substring(T src, NumberType pos, int len, character type)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.unknown value
if any
input is unknown
.public static <T extends Text> T substring(T src, int pos, int len, java.lang.String type)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.unknown value
if the
src
is unknown
.public static <T extends Text> T substring(T src, int pos, int len, character type)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.unknown value
if the
src
is unknown
.public static <T extends Text> T substring(T src, NumberType pos, NumberType len)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.unknown value
if any
input is unknown
.public static <T extends Text> T substring(T src, int pos, NumberType len)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.unknown value
if any
input is unknown
.public static <T extends Text> T substring(T src, NumberType pos, int len)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.unknown value
if any
input is unknown
.public static <T extends Text> T substring(T src, int pos, int len)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.unknown value
if the
src
is unknown
.public static <T extends Text> T substring(T src, NumberType pos)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.unknown value
if any
input is unknown
.public static <T extends Text> T substring(T src, int pos)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.unknown value
if the
src
is unknown
.public static character substring(java.lang.String src, int pos)
The returned instance is case-insensitive.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.public static character substring(java.lang.String src, NumberType pos)
The returned instance is case-insensitive.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.public static character substring(java.lang.String src, NumberType pos, NumberType len)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.unknown value
if any
input is unknown
.public static character substring(java.lang.String src, NumberType pos, int len)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.unknown value
if any
input is unknown
.public static character substring(java.lang.String src, int pos, NumberType len)
Case-sensitivity of the returned instance is determined by the
src
instance case-sensitivity.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.unknown value
if any
input is unknown
.public static character substring(java.lang.String src, int pos, int len)
The returned instance is case-insensitive.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.public static character substring(java.lang.String src, int pos, int len, java.lang.String type)
The returned instance is case-insensitive.
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.public static character substring(java.lang.String src, int pos, int len, java.lang.String type, boolean caseSens)
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.caseSens
- Determines the case-sensitivity of the returned instance.public static <T extends Text> T toLowerCase(T c)
This method does not handle the case of user-specified source and/or target codepages as is possible in Progress.
If the operand is case-sensitive, the result will be case-sensitive.
c
- The character instance to convert (cannot be
null
).unknown value
if the input string is
unknown value
.public static character toLowerCase(java.lang.String str)
This method does not handle the case of user-specified source and/or target codepages as is possible in Progress.
The result will be case-insensitive.
str
- The string to convert (cannot be null
).public static <T extends Text> T toUpperCase(T c)
This method does not handle the case of user-specified source and/or target codepages as is possible in Progress.
If the operand is case-sensitive, the result will be case-sensitive.
c
- The character instance to convert (cannot be
null
).unknown value
if the input string is
unknown value
.public static character toUpperCase(java.lang.String str)
This method does not handle the case of user-specified source and/or target codepages as is possible in Progress.
The result will be case-insensitive.
str
- The string to convert (cannot be null
).public static java.lang.String toUpperCase(java.lang.String str, boolean runtimeString)
This method does not handle the case of user-specified source and/or target codepages as is possible in Progress.
The result will be case-insensitive.
str
- The string to convert (cannot be null
).runtimeString
- true
if the target string is a runtime string,
false
if it is a hardcoded string into a source
file.public static <T extends Text> T trim(T input, character list)
Trim operations are performed based on the case-sensitivity of only the input parameter, the trim character list case-sensitivity is ignored. Likewise, if the input parameter is case-sensitive, then the returned instance will be case-sensitive.
input
- The string to trim.list
- The list of characters to trim.public static <T extends Text> T trim(T input, java.lang.String list)
Trim operations are performed based on the case-sensitivity of the input parameter. Likewise, if the input parameter is case-sensitive, then the returned instance will be case-sensitive.
input
- The string to trim.list
- The list of characters to trim.public static <T extends Text> T trim(T input)
Trim operations are performed based on the case-sensitivity of the input parameter. Likewise, if the input parameter is case-sensitive, then the returned instance will be case-sensitive.
input
- The string to trim.public static character trim(java.lang.String input, character list)
Trim operations are performed case-insensitively and the returned result will be case-insensitive.
input
- The string to trim.list
- The list of characters to trim.public static character trim(java.lang.String input, java.lang.String list)
null
the method defaults to space, tab, line feed and carriage return.
Trim operations and the returned instance will be case-insensitive.
input
- The string to trim.list
- The list of characters to trim or null
to
use the default list.public static character trim(java.lang.String input)
Trim operations and the returned instance will be case-insensitive.
input
- The string to trim.public static character trim(java.lang.String input, java.lang.String list, boolean caseSens)
null
the method defaults to space, tab, line feed and carriage return.input
- The string to trim.list
- The list of characters to trim or null
to
use the default list.caseSens
- Specifies the case-sensitivity of the trim operation AND of
the returned instance.public static java.lang.String trim(java.lang.String input, java.lang.String list, boolean left, boolean caseSens)
null
the method defaults to space.input
- The string to trim.list
- The list of characters to trim or null
to use the default list.left
- Specifies if the trim should occur on the left or right side of the string.caseSens
- If true
, a case-sensitive trim is performed.static void genNegativeIndexError()
static void genOutsideRangeError(int idx, java.lang.String list)
idx
- The index that is out of range.list
- The list being indexed.static java.lang.String fixupRegexChar(char ch)
ch
- The exact character on which to match.static void fixupRegexChar(char ch, java.lang.StringBuilder regex)
ch
- The exact character on which to match.static char safeDelimiter(java.lang.String delimiter)
delimiter
- Delimiter stringprivate static int getCompareOperator(character compare)
compare(Text, int, Text, int)
method.compare
- The operator's string representation.private static int getStrength(character strength)
compare(Text, int, Text, int)
method.strength
- The strength's string representation.private static <T extends Text> T entryImpl(java.lang.Class<T> cls, double ii, java.lang.String list, char delimit) throws ErrorConditionException
ii
- The 1-based index into the list.list
- The delimited list of entries.delimit
- The delimiter character.unknown value
if
any of the inputs are unknown value
.ErrorConditionException
private static <T extends Text> T instantiateUnknown(java.lang.Class<T> cls)
Text
subclass and set it to
unknown.cls
- A Text
subclass for which an unknown instance is
needed.private static <T extends Text> T instantiate(java.lang.Class<T> cls, java.lang.String val)
Text
subclass and set its
value. If the val
is null, the new instance will be set
to unknown.cls
- A Text
subclass for which a new instance is needed.val
- The value to set for the new instance.private static <T extends Text> T leftTrimImpl(java.lang.Class<T> cls, java.lang.String input, java.lang.String list, boolean caseSens)
null
the method defaults to space, tab, line feed and carriage return.input
- The string to trim.list
- The list of characters to trim or null
to
use the default list.caseSens
- Specifies the case-sensitivity of the trim operation AND of
the returned instance.private static <T extends Text> T replaceAllImpl(java.lang.Class<T> cls, java.lang.String src, java.lang.String from, java.lang.String to, boolean cs)
from
string in the
src
string and replaces these with the to
string.src
- The string to operate upon.from
- The substring to search for.to
- The substring to replace when a match is found.cs
- Determines if a case-sensitive match should be performed AND
the case-sensitivity of the returned instance.private static <T extends Text> T rightTrimImpl(java.lang.Class<T> cls, java.lang.String input, java.lang.String list, boolean caseSens)
null
the method defaults to space, tab, line feed and carriage return.input
- The string to trim.list
- The list of characters to trim or null
to
use the default list.caseSens
- Specifies the case-sensitivity of the trim operation AND of
the returned instance.private static <T extends Text> T substituteImpl(java.lang.Class<T> cls, java.lang.String fmt, java.lang.Object... replacements) throws ErrorConditionException
fmt
, using the array of character
and/or
String
objects as the list of replacements. The 1-based
index position of the '&n' specifiers (where n and range from 1 to
9) is converted to a 0-based index into the replacements
array. Instances of '&&' yield a single '&' in the result.
Any specifiers that do not correspond to an object in the array are
replaced with an empty string.fmt
- The string specifying the text and format specifiers.replacements
- The list of replacements.ErrorConditionException
private static <T extends Text> T substringImpl(java.lang.Class<T> cls, java.lang.String src, int pos, int len, java.lang.String type, boolean caseSens)
src
- The string to operate upon.pos
- The 1-based index at which the substring starts.len
- The length of the substring to return. Use -1 for the rest of
the string.type
- Specifies whether this substring operates on bytes or
characters. At this time only "raw" and "character" are
supported.caseSens
- Determines the case-sensitivity of the returned instance.private static <T extends Text> T toUpperCaseImpl(java.lang.Class<T> cls, java.lang.String str)
This method does not handle the case of user-specified source and/or target codepages as is possible in Progress.
The result will be case-insensitive.
str
- The string to convert (cannot be null
).private static <T extends Text> T toLowerCaseImpl(java.lang.Class<T> cls, java.lang.String str)
This method does not handle the case of user-specified source and/or target codepages as is possible in Progress.
The result will be case-insensitive.
str
- The string to convert (cannot be null
).private static <T extends Text> T trimImpl(java.lang.Class<T> cls, java.lang.String input, java.lang.String list, boolean caseSens)
null
the method defaults to space.input
- The string to trim.list
- The list of characters to trim or null
to use the default list.caseSens
- Specifies the case-sensitivity of the trim operation AND of the returned instance.private static integer length(java.lang.String c, java.lang.String type)
character
instance, using the type parameter
to determine the measurement.
This method checks the type
argument and decide to what method to delegate
the actual implementation depending on the 2nd parameter.c
- The instance to test.type
- The measurement mode.