public final class ArrayUtilities extends Object
Modifier and Type | Method and Description |
---|---|
static void |
appendBracketedIndex(StringBuffer sb,
int index,
int maxDigitCount) |
static void |
appendBracketedIndex(StringBuilder sb,
int index,
int maxDigitCount) |
static void |
appendIndex(StringBuffer sb,
int index,
int maxDigitCount) |
static void |
appendIndex(StringBuilder sb,
int index,
int maxDigitCount) |
static void |
appendSpaces(StringBuffer sb,
int spaceCount) |
static void |
appendSpaces(StringBuilder sb,
int spaceCount) |
static int |
binarySearch(int[] array,
int key)
Searches for the
key in the array . |
static int |
binarySearch(int[] array,
int start,
int end,
int key)
Searches for the
key in the array in the area
between start and end . |
static boolean[] |
booleanArray(boolean[] oldArray) |
static boolean[] |
booleanArray(boolean[] oldArray,
int newSize) |
static boolean[] |
booleanArray(boolean[] oldArray,
int newSize,
int copyLen,
boolean forwardFill) |
static char[] |
charArray(char[] oldArray) |
static char[] |
charArray(char[] oldArray,
int newSize) |
static char[] |
charArray(char[] oldArray,
int newSize,
int copyLen,
boolean forwardFill) |
static char[] |
charArray(char[] oldArray,
int newSize,
int gapStart,
int gapLength) |
static int |
digitCount(int number) |
static boolean[] |
emptyBooleanArray() |
static char[] |
emptyCharArray() |
static int[] |
emptyIntArray() |
static int[] |
intArray(int[] oldArray) |
static int[] |
intArray(int[] oldArray,
int newSize) |
static int[] |
intArray(int[] oldArray,
int newSize,
int copyLen,
boolean forwardFill) |
static int[] |
intArray(int[] oldArray,
int newSize,
int gapStart,
int gapLength) |
static String |
toString(int[] array) |
static String |
toString(Object[] array) |
static <E> List<E> |
unmodifiableList(E[] array)
Return unmodifiable list for the given array.
|
public static boolean[] booleanArray(boolean[] oldArray)
public static boolean[] booleanArray(boolean[] oldArray, int newSize)
public static boolean[] booleanArray(boolean[] oldArray, int newSize, int copyLen, boolean forwardFill)
public static char[] charArray(char[] oldArray)
public static char[] charArray(char[] oldArray, int newSize)
public static char[] charArray(char[] oldArray, int newSize, int copyLen, boolean forwardFill)
public static char[] charArray(char[] oldArray, int newSize, int gapStart, int gapLength)
public static int[] intArray(int[] oldArray)
public static int[] intArray(int[] oldArray, int newSize)
public static int[] intArray(int[] oldArray, int newSize, int copyLen, boolean forwardFill)
public static int[] intArray(int[] oldArray, int newSize, int gapStart, int gapLength)
public static boolean[] emptyBooleanArray()
public static char[] emptyCharArray()
public static int[] emptyIntArray()
public static int digitCount(int number)
public static void appendIndex(StringBuilder sb, int index, int maxDigitCount)
public static void appendIndex(StringBuffer sb, int index, int maxDigitCount)
public static void appendSpaces(StringBuilder sb, int spaceCount)
public static void appendSpaces(StringBuffer sb, int spaceCount)
public static void appendBracketedIndex(StringBuilder sb, int index, int maxDigitCount)
public static void appendBracketedIndex(StringBuffer sb, int index, int maxDigitCount)
public static <E> List<E> unmodifiableList(E[] array)
Collections.unmodifiableList()
this method
does not use any extra wrappers etc.public static String toString(int[] array)
public static int binarySearch(int[] array, int key)
key
in the array
.array
- the array to search inkey
- the number to search forkey
in the array
. For
details see ArrayUtilities.binarySearch(int[], int, int, int)
.public static int binarySearch(int[] array, int start, int end, int key)
key
in the array
in the area
between start
and end
.array
- the array to search instart
- the first index to look atend
- the last index to look atkey
- the number to search for