|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.sandev.basics.util.ArrayUtils
public class ArrayUtils
Simple array management utilities to fill gaps in common use.
| Constructor Summary | |
|---|---|
ArrayUtils()
|
|
| Method Summary | |
|---|---|
static int[] |
append(int[] oldarray,
int newelem)
The language supports an overloaded '+' operator for Strings, but you can't do the same thing with an array. |
static long[] |
append(long[] oldarray,
long newelem)
The language supports an overloaded '+' operator for Strings, but you can't do the same thing with an array. |
static SandMessage[] |
append(SandMessage[] oldarray,
SandMessage newelem)
The language supports an overloaded '+' operator for Strings, but you can't do the same thing with an array. |
static java.lang.String[] |
append(java.lang.String[] oldarray,
java.lang.String newelem)
The language supports an overloaded '+' operator for Strings, but you can't do the same thing with an array. |
static SandMessage[] |
conc(SandMessage[] first,
SandMessage[] second)
Concatenate the two arrays, returning a new array. |
static boolean |
contains(int[] arr,
int val)
Return true if the array contains the specified value, false otherwise. |
static boolean |
contains(long[] arr,
long val)
Return true if the array contains the specified value, false otherwise. |
static boolean |
contains(SandMessage[] arr,
SandMessage val)
Return true if the array contains the specified value, false otherwise. |
static boolean |
contains(java.lang.String[] arr,
java.lang.String val)
Return true if the array contains the specified value, false otherwise. |
static long[] |
diff(long[] newvals,
long[] oldvals)
Returns an array of all values in newvals that are not found in oldvals. |
static long |
firstDuplicate(long[] ids)
Returns the first duplicated id in the given array, or zero if no duplicate was found. |
static int |
indexOf(int[] arr,
int val)
Return the index of the specified value, or -1 if not found. |
static int |
indexOf(long[] arr,
long val)
Return the index of the specified value, or -1 if not found. |
static int |
indexOf(SandMessage[] arr,
SandMessage val)
Return the index of the specified value, or -1 if not found. |
static int |
indexOf(java.lang.String[] arr,
java.lang.String val)
Return the index of the specified value, or -1 if not found. |
static long[] |
intersect(long[] array1,
long[] array2)
Return only the values that occur in both array1 and array2 |
static java.lang.String[] |
longToString(long[] vals)
Convert the given array of long values to an array of string values. |
static boolean |
messageEqual(SandMessage sm1,
SandMessage sm2)
Returns true if the two messages refer to the same instance, false otherwise. |
static java.lang.String[] |
prepend(java.lang.String[] oldarray,
java.lang.String newelem)
The language supports an overloaded '+' operator for Strings, but you can't do the same thing with an array. |
static int[] |
remove(int[] arr,
int val)
Given an int array and an int value, return an int array with the first instance of that value removed. |
static int[] |
remove(int[] arr,
int val,
int[] work)
Given an int array and an int value, return an int array with the first instance of that value removed. |
static long[] |
remove(long[] arr,
long val)
Given a long array and a long value, return a long array with the first instance of that value removed. |
static long[] |
remove(long[] arr,
long val,
long[] work)
Given a long array and a long value, return a long array with the first instance of that value removed. |
static SandMessage[] |
remove(SandMessage[] arr,
SandMessage val,
SandMessage[] work)
Given a SandMessage array and value, return a SandMessage array with the first instance of that value removed. |
static SandUpdateMessage[] |
remove(SandUpdateMessage[] sums,
int index)
Return a new SandUpdateMessage array with the element at the given index removed. |
static java.lang.String[] |
remove(java.lang.String[] arr,
java.lang.String val)
Given a String array and a String value, return a String array with the first instance of that value removed. |
static java.lang.String[] |
remove(java.lang.String[] arr,
java.lang.String val,
java.lang.String[] work)
Given a String array and a String value, return a String array with the first instance of that value removed. |
static java.lang.String[] |
removeAt(java.lang.String[] arr,
int index)
Given a String array and an index, return a String array with the element at the specified index removed. |
static void |
reverse(long[] vals)
Reverse the contents of the array |
static SandMessage |
safeAcc(SandMessage[] array,
int index)
Provides safe access to the given item. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayUtils()
| Method Detail |
|---|
public static java.lang.String[] append(java.lang.String[] oldarray,
java.lang.String newelem)
public static long[] append(long[] oldarray,
long newelem)
public static int[] append(int[] oldarray,
int newelem)
public static SandMessage[] append(SandMessage[] oldarray,
SandMessage newelem)
public static java.lang.String[] prepend(java.lang.String[] oldarray,
java.lang.String newelem)
public static SandMessage[] conc(SandMessage[] first,
SandMessage[] second)
public static long[] diff(long[] newvals,
long[] oldvals)
public static long[] intersect(long[] array1,
long[] array2)
public static boolean contains(int[] arr,
int val)
public static boolean contains(long[] arr,
long val)
public static boolean contains(java.lang.String[] arr,
java.lang.String val)
public static boolean contains(SandMessage[] arr,
SandMessage val)
public static int indexOf(int[] arr,
int val)
public static int indexOf(long[] arr,
long val)
public static int indexOf(java.lang.String[] arr,
java.lang.String val)
public static int indexOf(SandMessage[] arr,
SandMessage val)
public static int[] remove(int[] arr,
int val)
public static int[] remove(int[] arr,
int val,
int[] work)
public static long[] remove(long[] arr,
long val)
public static long[] remove(long[] arr,
long val,
long[] work)
public static java.lang.String[] removeAt(java.lang.String[] arr,
int index)
public static java.lang.String[] remove(java.lang.String[] arr,
java.lang.String val)
public static java.lang.String[] remove(java.lang.String[] arr,
java.lang.String val,
java.lang.String[] work)
public static SandMessage[] remove(SandMessage[] arr,
SandMessage val,
SandMessage[] work)
public static SandUpdateMessage[] remove(SandUpdateMessage[] sums,
int index)
public static void reverse(long[] vals)
public static java.lang.String[] longToString(long[] vals)
public static boolean messageEqual(SandMessage sm1,
SandMessage sm2)
public static long firstDuplicate(long[] ids)
public static SandMessage safeAcc(SandMessage[] array,
int index)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||