|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.parboiled.common.Utils
public final class Utils
General utility methods.
Field Summary | |
---|---|
static java.lang.Boolean[] |
EMPTY_BOOLEAN_OBJECT_ARRAY
|
static java.lang.Byte[] |
EMPTY_BYTE_OBJECT_ARRAY
|
static java.lang.Character[] |
EMPTY_CHARACTER_OBJECT_ARRAY
|
static java.lang.Double[] |
EMPTY_DOUBLE_OBJECT_ARRAY
|
static java.lang.Float[] |
EMPTY_FLOAT_OBJECT_ARRAY
|
static java.lang.Integer[] |
EMPTY_INTEGER_OBJECT_ARRAY
|
static java.lang.Long[] |
EMPTY_LONG_OBJECT_ARRAY
|
static java.lang.Short[] |
EMPTY_SHORT_OBJECT_ARRAY
|
Method Summary | ||
---|---|---|
static
|
arrayOf(T[] firstElements,
T lastElement)
Joins the given arguments into one array. |
|
static
|
arrayOf(T firstElement,
T... moreElements)
Joins the given arguments into one array. |
|
static
|
arrayOf(T firstElement,
T secondElement,
T... moreElements)
Joins the given arguments into one array. |
|
static
|
equal(T a,
T b)
Null enabled equals(). |
|
static java.lang.reflect.Constructor |
findConstructor(java.lang.Class<?> type,
java.lang.Object[] args)
Finds the constructor of the given class that is compatible with the given arguments. |
|
static java.lang.Class<?> |
getClass(java.lang.reflect.Type type)
Get the underlying class for a type, or null if the type is a variable type. |
|
static java.util.List<java.lang.Class<?>> |
getTypeArguments(java.lang.Class<?> base,
java.lang.Class<?> implementation)
Gets the actual type arguments that are used in a given implementation of a given generic base class or interface. |
|
static java.lang.String |
humanize(long value)
Formats the given long value into a human readable notation using the Kilo, Mega, Giga, etc. |
|
static java.lang.Boolean[] |
toObjectArray(boolean[] array)
|
|
static java.lang.Byte[] |
toObjectArray(byte[] array)
|
|
static java.lang.Character[] |
toObjectArray(char[] array)
|
|
static java.lang.Double[] |
toObjectArray(double[] array)
|
|
static java.lang.Float[] |
toObjectArray(float[] array)
|
|
static java.lang.Integer[] |
toObjectArray(int[] array)
|
|
static java.lang.Long[] |
toObjectArray(long[] array)
|
|
static java.lang.Short[] |
toObjectArray(short[] array)
|
|
static java.lang.String |
toString(java.lang.Object obj)
Null enabled toString(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Character[] EMPTY_CHARACTER_OBJECT_ARRAY
public static final java.lang.Integer[] EMPTY_INTEGER_OBJECT_ARRAY
public static final java.lang.Long[] EMPTY_LONG_OBJECT_ARRAY
public static final java.lang.Short[] EMPTY_SHORT_OBJECT_ARRAY
public static final java.lang.Byte[] EMPTY_BYTE_OBJECT_ARRAY
public static final java.lang.Float[] EMPTY_FLOAT_OBJECT_ARRAY
public static final java.lang.Double[] EMPTY_DOUBLE_OBJECT_ARRAY
public static final java.lang.Boolean[] EMPTY_BOOLEAN_OBJECT_ARRAY
Method Detail |
---|
public static java.lang.Character[] toObjectArray(char[] array)
public static java.lang.Integer[] toObjectArray(int[] array)
public static java.lang.Long[] toObjectArray(long[] array)
public static java.lang.Short[] toObjectArray(short[] array)
public static java.lang.Byte[] toObjectArray(byte[] array)
public static java.lang.Float[] toObjectArray(float[] array)
public static java.lang.Double[] toObjectArray(double[] array)
public static java.lang.Boolean[] toObjectArray(boolean[] array)
public static <T> T[] arrayOf(T firstElement, T... moreElements)
firstElement
- the first elementmoreElements
- more elements (optional)
public static <T> T[] arrayOf(T firstElement, T secondElement, T... moreElements)
firstElement
- the first elementsecondElement
- the second elementmoreElements
- more elements (optional)
public static <T> T[] arrayOf(T[] firstElements, T lastElement)
firstElements
- the first elementslastElement
- the element to append
public static java.lang.String toString(java.lang.Object obj)
obj
- the object
public static <T> boolean equal(T a, T b)
a
- the first objectb
- the second object
public static java.util.List<java.lang.Class<?>> getTypeArguments(java.lang.Class<?> base, java.lang.Class<?> implementation)
base
- the generic base class or interfaceimplementation
- the type (potentially) implementing the given base class or interface
public static java.lang.Class<?> getClass(java.lang.reflect.Type type)
type
- the type
public static java.lang.reflect.Constructor findConstructor(java.lang.Class<?> type, java.lang.Object[] args)
type
- the class to find the constructor ofargs
- the arguments
public static java.lang.String humanize(long value)
value
- the value to format
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |