|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.acorn.util.converter.Arrays
public abstract class Arrays
Converts between array types.
| Constructor Summary | |
|---|---|
Arrays()
|
|
| Method Summary | |
|---|---|
static boolean |
equals(Object a1,
Object a2)
Checks whether two objects, whether arrays or single ones, are equal. |
static Object |
newArray(Class class1,
Class class2,
int length)
Returns a new array of the specified length and of assignment compatible type with the specified classes. |
static Object |
newArray(Object object1,
Object object2)
Returns a new array long enough to hold the specified objects and of assigment compatible type with the objects. |
static String[] |
toArray(Locale locale)
Tokenizes a locale and returns the tokens in an array. |
static String[] |
toArray(Locale locale,
String variant)
Tokenizes a locale and variant and returns the tokens in an array. |
static Object |
toArray(Object array,
int index,
int length)
Returns a range from the specified array. |
static Object |
toArray(Object object1,
int index,
Object object2)
Returns the specified objects in a new array of assignment compatible type with the objects. |
static Object |
toArray(Object object1,
int index,
Object object2,
Object array)
Returns the specified objects in the given array. |
static Object |
toArray(Object object1,
Object object2)
Returns the specified objects in a new array of assignment compatible type with the objects. |
static Object |
toArray(Object object1,
Object object2,
Object array)
Returns the specified objects in the given array. |
static String[] |
toArray(String lines)
Converts the CR, LF and CRLF separated lines of a string to an array. |
static Object |
toCloned(Object array)
Clones an array and its elements. |
static Object |
toCopied(Object array)
Copies an array. |
static int[] |
toDimensions(Object array)
Converts the specified array to its dimensions. |
static String |
toLines(Object[] array)
Converts an array to CRLF separated lines. |
static List |
toList(Object array)
Converts the specified array to a list. |
static Object[] |
toObject(Object array)
Converts primitives to the corresponding objects. |
static Object |
toPrimitive(Object array)
Converts objects to the corresponding primitives. |
static Object |
toPrimitive(Object array,
Class type)
Converts objects to the corresponding primitives. |
static Object |
toString(Object array)
Copies an array to strings. |
static void |
trim(String[] array)
Trims elements of a string array and converts empty string to nulls. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Arrays()
| Method Detail |
|---|
public static Object newArray(Class class1,
Class class2,
int length)
class1 - the first class.class2 - the second object.length - the array length.
public static Object newArray(Object object1,
Object object2)
object1 - the first object.object2 - the second object.
public static List toList(Object array)
array - the array to convert.
IllegalArgumentException - if array is not an array.public static int[] toDimensions(Object array)
array - the array to convert.
public static Object toPrimitive(Object array)
Note that nulls are converted to zeros or falses.
array - the objects to convert.
ClassCastException - if conversion is not possible.
UnsupportedOperationException - if conversion not supported.
public static Object toPrimitive(Object array,
Class type)
Note that nulls are converted to zeros or falses.
array - the objects to convert.type - the primitive type.
ClassCastException - if conversion is not possible.
IllegalArgumentException - if array is not an array.
UnsupportedOperationException - if conversion not supported.public static Object[] toObject(Object array)
array - the primitives to convert.
IllegalArgumentException - if array is not an array.
UnsupportedOperationException - if conversion is not supported.public static Object toCopied(Object array)
Primitive and multi-dimensional arrays are also supported.
array - the array to copy.
public static Object toCloned(Object array)
Primitive and multi-dimensional arrays are also supported.
array - the array to clone.
public static Object toString(Object array)
Primitive and multi-dimensional arrays are also supported.
array - the array to copy.
public static Object toArray(Object object1,
Object object2)
object1 - the first object.object2 - the second object.
public static Object toArray(Object object1,
int index,
Object object2)
object1 - the first object.index - the index.object2 - the second object.
public static Object toArray(Object object1,
Object object2,
Object array)
The runtime type of the returned array is that of the specified array. If the objects fit in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of the combined size of the objects.
If the objects fit into the specified array with room to spare, the element in the array immediately following the end of the objects is set to null.
object1 - the first object.object2 - the second object.array - the result array.
IllegalArgumentException - if the array is invalid.
public static Object toArray(Object object1,
int index,
Object object2,
Object array)
The runtime type of the returned array is that of the specified array. If the objects fit in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of the combined size of the objects.
If the objects fit into the specified array with room to spare, the element in the array immediately following the end of the objects is set to null.
object1 - the first object.index - the index.object2 - the second object.array - the result array.
IllegalArgumentException - if the array is invalid.
ArrayIndexOutOfBoundsException - if the index is invalid.
public static Object toArray(Object array,
int index,
int length)
array - the array.index - the index.length - the length.
public static String[] toArray(String lines)
lines - the lines to convert.
public static String toLines(Object[] array)
array - the array to convert.
public static String[] toArray(Locale locale)
locale - the locale to tokenize.
public static String[] toArray(Locale locale,
String variant)
locale - the locale to tokenize.variant - a optional variant.
public static void trim(String[] array)
array - the array to trim.
public static boolean equals(Object a1,
Object a2)
a1 - the first object.a2 - the second object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||