|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.faunos.util.Measure
public class Measure
Utilty for comparing and measuring various common object types and primitives (such as char). Most of the methods in this class have well-defined behavior when invoked with one or more null parameters.
Method Summary | ||
---|---|---|
static boolean |
equal(Object a,
Object b)
Compares the two given objects for equality. |
|
static int |
getCommonPrefixLength(CharSequence a,
CharSequence b)
Returns the length of the prefix shared by the two given strings (never negative). |
|
static int |
getLength(CharSequence string)
Returns the length of the given string. |
|
static int |
getLength(Object[] array)
Returns the length of the given array if not null; -1, otherwise. |
|
static int |
getSize(Collection<?> collection)
Returns the size of the given collection if not null; -1, otherwise. |
|
static int |
indexOf(CharSequence string,
char c)
Returns the index of the first occurrence of c in string, if found; returns -1, otherwise. |
|
static int |
indexOf(CharSequence string,
char c,
int fromIndex)
Returns the index of the first occurrence of c in string that is ≥ fromIndex, if found; returns -1, otherwise. |
|
static int |
indexOf(CharSequence string,
CharSequence pattern)
Returns the index of the first occurrence of the specified pattern in the given string, if found; returns -1, otherwise. |
|
static int |
indexOf(CharSequence string,
CharSequence pattern,
int fromIndex)
Returns the index of the first occurrence of the specified pattern in the given string that is ≥ to fromIndex, if found; returns -1, otherwise. |
|
static int |
indexOfNonspace(CharSequence string,
int fromIndex)
Returns the index of the first non-space character in the given string, starting from fromIndex, if found; returns -1, otherwise. |
|
static int |
indexOfSpace(CharSequence string,
int fromIndex)
Returns the index of the first space character in the given string, starting from fromIndex, if found; returns -1, otherwise. |
|
static boolean |
isDigit(char ch)
|
|
static boolean |
isEmpty(CharSequence string)
Determines whether the given string is empty. |
|
static boolean |
isEmpty(Collection<?> collection)
Determines whether the given collection is empty. |
|
static boolean |
isEmpty(Object[] array)
Determines whether the given array is empty. |
|
static boolean |
isFilepath(CharSequence path)
|
|
static boolean |
isFilepath(CharSequence path,
char seperator)
|
|
static boolean |
isLowerCaseAscii(char ch)
|
|
static boolean |
isSubpathChar(char ch)
|
|
static boolean |
isSubpathOf(CharSequence subpath,
CharSequence parent)
Determines whether the given subpath is in fact a subpath of the specified parent path. |
|
static boolean |
isSubpathOf(CharSequence subpath,
CharSequence parent,
char sep)
Determines whether the given subpath is in fact a subpath of the specified parent path. |
|
static boolean |
isUpperCaseAscii(char ch)
|
|
static int |
lastIndexOf(CharSequence string,
char c)
Returns the last index of the character c in the given string, if found; returns -1, otherwise. |
|
static int |
lastIndexOf(CharSequence string,
char c,
int fromIndex)
Returns the last index of the character c in the given string that is ≤ fromIndex, if found; returns -1, otherwise. |
|
static int |
lastIndexOf(CharSequence string,
CharSequence pattern)
Returns the last index of the specified pattern in the given string, if found; returns -1, otherwise. |
|
static int |
lastIndexOf(CharSequence string,
CharSequence pattern,
int fromIndex)
Returns the last index of the specified pattern in the given string that is ≤ fromIndex, if found; returns -1, otherwise. |
|
static
|
naturalComparator()
|
|
static boolean |
startsWith(CharSequence string,
CharSequence start)
Determines whether the given string starts with the given start sequence. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean equal(Object a, Object b)
public static boolean isEmpty(Object[] array)
public static boolean isEmpty(CharSequence string)
public static boolean isEmpty(Collection<?> collection)
public static int getLength(CharSequence string)
public static boolean startsWith(CharSequence string, CharSequence start)
public static int indexOf(CharSequence string, char c)
string
- the char sequence to be searched. Must not be null.public static int indexOf(CharSequence string, char c, int fromIndex)
string
- the char sequence to be searched. Must not be null.public static int indexOfSpace(CharSequence string, int fromIndex)
string
- the char sequence to be searched. Must not be null.public static int indexOfNonspace(CharSequence string, int fromIndex)
string
- the char sequence to be searched. Must not be null.public static int indexOf(CharSequence string, CharSequence pattern)
public static int indexOf(CharSequence string, CharSequence pattern, int fromIndex)
public static int lastIndexOf(CharSequence string, char c)
string
- the char sequence to be searched. Must not be null.public static int lastIndexOf(CharSequence string, char c, int fromIndex)
string
- the char sequence to be searched. Must not be null.public static int lastIndexOf(CharSequence string, CharSequence pattern)
public static int lastIndexOf(CharSequence string, CharSequence pattern, int fromIndex)
public static int getLength(Object[] array)
public static int getSize(Collection<?> collection)
public static int getCommonPrefixLength(CharSequence a, CharSequence b)
public static boolean isSubpathOf(CharSequence subpath, CharSequence parent)
public static boolean isSubpathOf(CharSequence subpath, CharSequence parent, char sep)
sep
- the separator character (usually '/')public static boolean isSubpathChar(char ch)
public static boolean isDigit(char ch)
public static boolean isLowerCaseAscii(char ch)
public static boolean isUpperCaseAscii(char ch)
public static boolean isFilepath(CharSequence path)
public static boolean isFilepath(CharSequence path, char seperator)
public static <T extends Comparable<T>> Comparator<T> naturalComparator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |