|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaggregate.Strings
public class Strings
Utility class that offers common operations on strings.
| Field Summary | |
|---|---|
static UnaryFunctor<String,Integer> |
LENGTH
A function which gives the length of its argument. |
| Method Summary | |
|---|---|
static UnaryFunction<String,Character> |
charAt(int index)
Answers a function which will give the character value of a string target at the given index. |
static UnaryPredicate<String> |
endsWith(String suffix)
Answers a predicate which will answer true if its argument ends with the
given suffix. |
static UnaryPredicate<String> |
equalsIgnoreCase(String comparand)
Answers a predicate which will answer true if its argument is equivalent
to the given comparand, disregarding case. |
static UnaryPredicate<String> |
hasSameContentsAs(CharSequence comparand)
Answers a predicate which will answer true if its argument has the same
string contents as the given comparand. |
static UnaryPredicate<String> |
hasSubstring(CharSequence substring)
Answers a predicate which will answer true if the given substring occurs
anywhere within its argument. |
static UnaryFunction<String,Integer> |
indexOf(int ch)
Answers a function which will give the first index of a given character value in a given string. |
static UnaryFunction<String,Integer> |
indexOf(String substring)
Answers a function which will give the first index of a given substring in a given string. |
static UnaryPredicate<String> |
isPrefixOf(String target)
Answers a predicate which will answer true if its argument is a prefix
of the given target. |
static UnaryPredicate<CharSequence> |
isSubstringOf(String target)
Answers a predicate which will answer true if the given string has the
predicate's argument as a substring. |
static UnaryPredicate<String> |
isSuffixOf(String target)
Answers a predicate which will answer true if its argument is a suffix of
the given string. |
static UnaryFunction<String,Integer> |
lastIndexOf(int ch)
Answers a function which will give the last index of a given character value in a given string. |
static UnaryFunction<String,Integer> |
lastIndexOf(String substring)
Answers a function which will give the last index of a given substring in a given string. |
static UnaryPredicate<CharSequence> |
matchesPattern(String pattern)
Answers a predicate which will answer true if any part of its argument
matches the given regular expression pattern. |
static UnaryPredicate<String> |
patternMatches(CharSequence target)
Answers a predicate which will answer true if its regular expression
pattern argument matches the given target. |
static UnaryPredicate<String> |
startsWith(String prefix)
Answers a predicate which will answer true if its argument starts with
the given prefix. |
static UnaryFunction<String,String> |
substring(int index)
Answers a function which will give the substring of a given string beginning at the given index. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final UnaryFunctor<String,Integer> LENGTH
String.length()| Method Detail |
|---|
public static UnaryPredicate<String> hasSubstring(CharSequence substring)
true if the given substring occurs
anywhere within its argument.
substring - the comparand to use with the returned predicate
substring
NullPointerException - if substring is nullString.contains(CharSequence)public static UnaryPredicate<CharSequence> isSubstringOf(String target)
true if the given string has the
predicate's argument as a substring.
target - the comparand to use with the returned predicate
target
NullPointerException - if target is nullString.contains(CharSequence)public static UnaryPredicate<String> hasSameContentsAs(CharSequence comparand)
true if its argument has the same
string contents as the given comparand.
comparand - the comparand to use with the returned predicate
comparand
NullPointerException - if comparand is nullString.contentEquals(CharSequence)public static UnaryPredicate<String> endsWith(String suffix)
true if its argument ends with the
given suffix.
suffix - the comparand to use with the returned predicate
suffix
NullPointerException - if suffix is nullString.endsWith(String)public static UnaryPredicate<String> isSuffixOf(String target)
true if its argument is a suffix of
the given string.
target - the comparand to use with the returned predicate
target
NullPointerException - if target is nullString.endsWith(String)public static UnaryPredicate<String> startsWith(String prefix)
true if its argument starts with
the given prefix.
prefix - the comparand to use with the returned predicate
prefix
NullPointerException - if prefix is nullpublic static UnaryPredicate<String> isPrefixOf(String target)
true if its argument is a prefix
of the given target.
target - the comparand to use with the returned predicate
target
NullPointerException - if target is nullpublic static UnaryPredicate<String> equalsIgnoreCase(String comparand)
true if its argument is equivalent
to the given comparand, disregarding case.
comparand - the comparand to use with the returned predicate
comparand
NullPointerException - if comparand is nullString.equalsIgnoreCase(String)public static UnaryPredicate<CharSequence> matchesPattern(String pattern)
true if any part of its argument
matches the given regular expression pattern.
pattern - the comparand to use with the returned predicate
pattern
NullPointerException - if pattern is nullMatcher.find()public static UnaryPredicate<String> patternMatches(CharSequence target)
true if its regular expression
pattern argument matches the given target.
target - the comparand to use with the returned predicate
target
NullPointerException - if target is nullMatcher.find()public static UnaryFunction<String,Character> charAt(int index)
index - index into a target string
indexString.charAt(int)public static UnaryFunction<String,Integer> indexOf(int ch)
ch - desired character in the target string
chString.indexOf(int)public static UnaryFunction<String,Integer> indexOf(String substring)
substring - desired substring in the target string
substringString.indexOf(String)public static UnaryFunction<String,Integer> lastIndexOf(int ch)
ch - desired character in the target string
chString.lastIndexOf(int)public static UnaryFunction<String,Integer> lastIndexOf(String substring)
substring - desired substring in the target string
substringString.lastIndexOf(String)public static UnaryFunction<String,String> substring(int index)
index - index at which to start the substring
String.substring(int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||