|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectetomica.util.Arrays
public final class Arrays
Non-instantiable class with static utility methods for working with arrays.
| Method Summary | |
|---|---|
static Object[] |
addObject(Object[] objects,
Object newObject)
Returns an array formed from adding the newObject to the elements in the given array. |
static Object[] |
removeObject(Object[] array,
Object object)
Returns an array formed by removing the given object from the given array. |
static boolean[] |
resizeArray(boolean[] oldArray,
int newSize)
Returns a new array holding the values in the given array, but adjusted to the given size. |
static double[] |
resizeArray(double[] oldArray,
int newSize)
Returns a new array holding the values in the given array, but adjusted to the given size. |
static int[] |
resizeArray(int[] oldArray,
int newSize)
Returns a new array holding the values in the given array, but adjusted to the given size. |
static Object[] |
resizeArray(Object[] oldArray,
int newSize)
Returns a new array holding the objects in the given array, but adjusted to the given size. |
static LinkedList |
toList(Object[] obj)
Creates a new LinkedList filled with the elements of the given array, in the same order. |
static String |
toString(boolean[] array)
Converts the given array of booleans into a string with a comma-separated list of the booleans enclosed by braces. |
static String |
toString(double[] array)
Converts the given array of doubles into a string with a comma-separated list of the doubles enclosed by braces. |
static String |
toString(float[] array)
Converts the given array of floats into a string with a comma-separated list of the floats enclosed by braces. |
static String |
toString(int[] array)
Converts the given array of integers into a string with a comma-separated list of the integers enclosed by braces. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Object[] resizeArray(Object[] oldArray,
int newSize)
oldArray - array with elements to be copied to the new arraynewSize - size of the new array
public static double[] resizeArray(double[] oldArray,
int newSize)
oldArray - array with elements to be copied to the new arraynewSize - size of the new array
public static int[] resizeArray(int[] oldArray,
int newSize)
oldArray - array with elements to be copied to the new arraynewSize - size of the new array
public static boolean[] resizeArray(boolean[] oldArray,
int newSize)
oldArray - array with elements to be copied to the new arraynewSize - size of the new array
public static Object[] addObject(Object[] objects,
Object newObject)
objects - array with objects to be put in new arraynewObject - object placed at end of new array
public static Object[] removeObject(Object[] array,
Object object)
array - array with the objectsnewObject - object being removed
public static String toString(int[] array)
public static String toString(double[] array)
public static String toString(float[] array)
public static String toString(boolean[] array)
public static LinkedList toList(Object[] obj)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||