Java org.apache.commons.lang ArrayUtils fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.lang ArrayUtils fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.lang ArrayUtils.

The text is from its open source code.

Subclass

org.apache.commons.lang.ArrayUtils has subclasses.
Click this link to see all its subclasses.

Field

Object[]EMPTY_OBJECT_ARRAY
An empty immutable Object array.
ClassEMPTY_CLASS_ARRAY
An empty immutable Class array.
String[]EMPTY_STRING_ARRAY
An empty immutable String array.
nullEMPTY_LONG_ARRAY
An empty immutable long array.
Long[]EMPTY_LONG_OBJECT_ARRAY
An empty immutable Long array.
nullEMPTY_INT_ARRAY
An empty immutable int array.
Integer[]EMPTY_INTEGER_OBJECT_ARRAY
An empty immutable Integer array.
nullEMPTY_SHORT_ARRAY
An empty immutable short array.
nullEMPTY_BYTE_ARRAY
An empty immutable byte array.
Byte[]EMPTY_BYTE_OBJECT_ARRAY
An empty immutable Byte array.
nullEMPTY_DOUBLE_ARRAY
An empty immutable double array.
Double[]EMPTY_DOUBLE_OBJECT_ARRAY
An empty immutable Double array.
nullEMPTY_FLOAT_ARRAY
An empty immutable float array.
nullEMPTY_BOOLEAN_ARRAY
An empty immutable boolean array.
nullEMPTY_CHAR_ARRAY
An empty immutable char array.
Character[]EMPTY_CHARACTER_OBJECT_ARRAY
An empty immutable Character array.
intINDEX_NOT_FOUND
The index value when an element is not found in a list or array: -1.

Method

Object[]add(Object[] array, Object element)

Copies the given array and adds the given element at the end of the new array.

boolean[]add(boolean[] array, boolean element)

Copies the given array and adds the given element at the end of the new array.

byte[]add(byte[] array, byte element)

Copies the given array and adds the given element at the end of the new array.

char[]add(char[] array, char element)

Copies the given array and adds the given element at the end of the new array.

double[]add(double[] array, double element)

Copies the given array and adds the given element at the end of the new array.

float[]add(float[] array, float element)

Copies the given array and adds the given element at the end of the new array.

int[]add(int[] array, int element)

Copies the given array and adds the given element at the end of the new array.

long[]add(long[] array, long element)

Copies the given array and adds the given element at the end of the new array.

short[]add(short[] array, short element)

Copies the given array and adds the given element at the end of the new array.

Object[]add(Object[] array, int index, Object element)

Inserts the specified element at the specified position in the array.

boolean[]add(boolean[] array, int index, boolean element)

Inserts the specified element at the specified position in the array.

char[]add(char[] array, int index, char element)

Inserts the specified element at the specified position in the array.

byte[]add(byte[] array, int index, byte element)

Inserts the specified element at the specified position in the array.

short[]add(short[] array, int index, short element)

Inserts the specified element at the specified position in the array.

int[]add(int[] array, int index, int element)

Inserts the specified element at the specified position in the array.

long[]add(long[] array, int index, long element)

Inserts the specified element at the specified position in the array.

float[]add(float[] array, int index, float element)

Inserts the specified element at the specified position in the array.

double[]add(double[] array, int index, double element)

Inserts the specified element at the specified position in the array.

Object[]addAll(Object[] array1, Object[] array2)

Adds all the elements of the given arrays into a new array.

boolean[]addAll(boolean[] array1, boolean[] array2)

Adds all the elements of the given arrays into a new array.

char[]addAll(char[] array1, char[] array2)

Adds all the elements of the given arrays into a new array.

byte[]addAll(byte[] array1, byte[] array2)

Adds all the elements of the given arrays into a new array.

short[]addAll(short[] array1, short[] array2)

Adds all the elements of the given arrays into a new array.

int[]addAll(int[] array1, int[] array2)

Adds all the elements of the given arrays into a new array.

long[]addAll(long[] array1, long[] array2)

Adds all the elements of the given arrays into a new array.

float[]addAll(float[] array1, float[] array2)

Adds all the elements of the given arrays into a new array.

double[]addAll(double[] array1, double[] array2)

Adds all the elements of the given arrays into a new array.

Object[]clone(Object[] array)

Shallow clones an array returning a typecast result and handling null.

long[]clone(long[] array)

Clones an array returning a typecast result and handling null.

int[]clone(int[] array)

Clones an array returning a typecast result and handling null.

short[]clone(short[] array)

Clones an array returning a typecast result and handling null.

char[]clone(char[] array)

Clones an array returning a typecast result and handling null.

byte[]clone(byte[] array)

Clones an array returning a typecast result and handling null.

double[]clone(double[] array)

Clones an array returning a typecast result and handling null.

float[]clone(float[] array)

Clones an array returning a typecast result and handling null.

boolean[]clone(boolean[] array)

Clones an array returning a typecast result and handling null.

booleancontains(Object[] array, Object objectToFind)

Checks if the object is in the given array.

booleancontains(long[] array, long valueToFind)

Checks if the value is in the given array.

booleancontains(int[] array, int valueToFind)

Checks if the value is in the given array.

booleancontains(short[] array, short valueToFind)

Checks if the value is in the given array.

booleancontains(char[] array, char valueToFind)

Checks if the value is in the given array.

booleancontains(byte[] array, byte valueToFind)

Checks if the value is in the given array.

booleancontains(double[] array, double valueToFind)

Checks if the value is in the given array.

booleancontains(float[] array, float valueToFind)

Checks if the value is in the given array.

booleancontains(boolean[] array, boolean valueToFind)

Checks if the value is in the given array.

intgetLength(Object array)

Returns the length of the specified array.

intindexOf(Object[] array, Object objectToFind)

Finds the index of the given object in the array.

intindexOf(long[] array, long valueToFind)

Finds the index of the given value in the array.

intindexOf(int[] array, int valueToFind)

Finds the index of the given value in the array.

intindexOf(short[] array, short valueToFind)

Finds the index of the given value in the array.

intindexOf(char[] array, char valueToFind)

Finds the index of the given value in the array.

intindexOf(byte[] array, byte valueToFind)

Finds the index of the given value in the array.

intindexOf(double[] array, double valueToFind)

Finds the index of the given value in the array.

intindexOf(float[] array, float valueToFind)

Finds the index of the given value in the array.

intindexOf(boolean[] array, boolean valueToFind)

Finds the index of the given value in the array.

intindexOf(Object[] array, Object objectToFind, int startIndex)

Finds the index of the given object in the array starting at the given index.

intindexOf(long[] array, long valueToFind, int startIndex)

Finds the index of the given value in the array starting at the given index.

intindexOf(int[] array, int valueToFind, int startIndex)

Finds the index of the given value in the array starting at the given index.

intindexOf(short[] array, short valueToFind, int startIndex)

Finds the index of the given value in the array starting at the given index.

intindexOf(char[] array, char valueToFind, int startIndex)

Finds the index of the given value in the array starting at the given index.

intindexOf(byte[] array, byte valueToFind, int startIndex)

Finds the index of the given value in the array starting at the given index.

intindexOf(double[] array, double valueToFind, double tolerance)

Finds the index of the given value within a given tolerance in the array.

intindexOf(double[] array, double valueToFind, int startIndex)

Finds the index of the given value in the array starting at the given index.

intindexOf(float[] array, float valueToFind, int startIndex)

Finds the index of the given value in the array starting at the given index.

intindexOf(boolean[] array, boolean valueToFind, int startIndex)

Finds the index of the given value in the array starting at the given index.

booleanisEmpty(Object[] array)

Checks if an array of Objects is empty or null.

booleanisEmpty(long[] array)

Checks if an array of primitive longs is empty or null.

booleanisEmpty(int[] array)

Checks if an array of primitive ints is empty or null.

booleanisEmpty(short[] array)

Checks if an array of primitive shorts is empty or null.

booleanisEmpty(char[] array)

Checks if an array of primitive chars is empty or null.

booleanisEmpty(byte[] array)

Checks if an array of primitive bytes is empty or null.

booleanisEmpty(double[] array)

Checks if an array of primitive doubles is empty or null.

booleanisEmpty(float[] array)

Checks if an array of primitive floats is empty or null.

booleanisEmpty(boolean[] array)

Checks if an array of primitive booleans is empty or null.

booleanisNotEmpty(Object[] array)

Checks if an array of Objects is not empty or not null.

booleanisNotEmpty(long[] array)

Checks if an array of primitive longs is not empty or not null.

booleanisNotEmpty(int[] array)

Checks if an array of primitive ints is not empty or not null.

booleanisNotEmpty(short[] array)

Checks if an array of primitive shorts is not empty or not null.

booleanisNotEmpty(char[] array)

Checks if an array of primitive chars is not empty or not null.

booleanisNotEmpty(byte[] array)

Checks if an array of primitive bytes is not empty or not null.

booleanisNotEmpty(double[] array)

Checks if an array of primitive doubles is not empty or not null.

booleanisNotEmpty(float[] array)

Checks if an array of primitive floats is not empty or not null.

booleanisNotEmpty(boolean[] array)

Checks if an array of primitive booleans is not empty or not null.

booleanisSameLength(Object[] array1, Object[] array2)

Checks whether two arrays are the same length, treating null arrays as length 0.

booleanisSameLength(long[] array1, long[] array2)

Checks whether two arrays are the same length, treating null arrays as length 0.

booleanisSameLength(int[] array1, int[] array2)

Checks whether two arrays are the same length, treating null arrays as length 0.

booleanisSameLength(short[] array1, short[] array2)

Checks whether two arrays are the same length, treating null arrays as length 0.

booleanisSameLength(char[] array1, char[] array2)

Checks whether two arrays are the same length, treating null arrays as length 0.

booleanisSameLength(byte[] array1, byte[] array2)

Checks whether two arrays are the same length, treating null arrays as length 0.

booleanisSameLength(double[] array1, double[] array2)

Checks whether two arrays are the same length, treating null arrays as length 0.

booleanisSameLength(float[] array1, float[] array2)

Checks whether two arrays are the same length, treating null arrays as length 0.

booleanisSameLength(boolean[] array1, boolean[] array2)

Checks whether two arrays are the same length, treating null arrays as length 0.

intlastIndexOf(Object[] array, Object objectToFind)

Finds the last index of the given object within the array.

intlastIndexOf(long[] array, long valueToFind)

Finds the last index of the given value within the array.

intlastIndexOf(int[] array, int valueToFind)

Finds the last index of the given value within the array.

intlastIndexOf(short[] array, short valueToFind)

Finds the last index of the given value within the array.

intlastIndexOf(char[] array, char valueToFind)

Finds the last index of the given value within the array.

intlastIndexOf(byte[] array, byte valueToFind)

Finds the last index of the given value within the array.

intlastIndexOf(double[] array, double valueToFind)

Finds the last index of the given value within the array.

intlastIndexOf(float[] array, float valueToFind)

Finds the last index of the given value within the array.

intlastIndexOf(boolean[] array, boolean valueToFind)

Finds the last index of the given value within the array.

Object[]nullToEmpty(Object[] array)

Defensive programming technique to change a null reference to an empty one.

String[]nullToEmpty(String[] array)

Defensive programming technique to change a null reference to an empty one.

long[]nullToEmpty(long[] array)

Defensive programming technique to change a null reference to an empty one.

int[]nullToEmpty(int[] array)

Defensive programming technique to change a null reference to an empty one.

short[]nullToEmpty(short[] array)

Defensive programming technique to change a null reference to an empty one.

char[]nullToEmpty(char[] array)

Defensive programming technique to change a null reference to an empty one.

byte[]nullToEmpty(byte[] array)

Defensive programming technique to change a null reference to an empty one.

double[]nullToEmpty(double[] array)

Defensive programming technique to change a null reference to an empty one.

float[]nullToEmpty(float[] array)

Defensive programming technique to change a null reference to an empty one.

boolean[]nullToEmpty(boolean[] array)

Defensive programming technique to change a null reference to an empty one.

Long[]nullToEmpty(Long[] array)

Defensive programming technique to change a null reference to an empty one.

Integer[]nullToEmpty(Integer[] array)

Defensive programming technique to change a null reference to an empty one.

Short[]nullToEmpty(Short[] array)

Defensive programming technique to change a null reference to an empty one.

Character[]nullToEmpty(Character[] array)

Defensive programming technique to change a null reference to an empty one.

Byte[]nullToEmpty(Byte[] array)

Defensive programming technique to change a null reference to an empty one.

Double[]nullToEmpty(Double[] array)

Defensive programming technique to change a null reference to an empty one.

Float[]nullToEmpty(Float[] array)

Defensive programming technique to change a null reference to an empty one.

Boolean[]nullToEmpty(Boolean[] array)

Defensive programming technique to change a null reference to an empty one.

Object[]remove(Object[] array, int index)

Removes the element at the specified position from the specified array.

boolean[]remove(boolean[] array, int index)

Removes the element at the specified position from the specified array.

byte[]remove(byte[] array, int index)

Removes the element at the specified position from the specified array.

char[]remove(char[] array, int index)

Removes the element at the specified position from the specified array.

double[]remove(double[] array, int index)

Removes the element at the specified position from the specified array.

float[]remove(float[] array, int index)

Removes the element at the specified position from the specified array.

int[]remove(int[] array, int index)

Removes the element at the specified position from the specified array.

long[]remove(long[] array, int index)

Removes the element at the specified position from the specified array.

short[]remove(short[] array, int index)

Removes the element at the specified position from the specified array.

Objectremove(Object array, int index)

Removes the element at the specified position from the specified array.

Object[]removeElement(Object[] array, Object element)

Removes the first occurrence of the specified element from the specified array.

boolean[]removeElement(boolean[] array, boolean element)

Removes the first occurrence of the specified element from the specified array.

byte[]removeElement(byte[] array, byte element)

Removes the first occurrence of the specified element from the specified array.

char[]removeElement(char[] array, char element)

Removes the first occurrence of the specified element from the specified array.

double[]removeElement(double[] array, double element)

Removes the first occurrence of the specified element from the specified array.

float[]removeElement(float[] array, float element)

Removes the first occurrence of the specified element from the specified array.

int[]removeElement(int[] array, int element)

Removes the first occurrence of the specified element from the specified array.

long[]removeElement(long[] array, long element)

Removes the first occurrence of the specified element from the specified array.

short[]removeElement(short[] array, short element)

Removes the first occurrence of the specified element from the specified array.

voidreverse(Object[] array)

Reverses the order of the given array.

voidreverse(long[] array)

Reverses the order of the given array.

voidreverse(int[] array)

Reverses the order of the given array.

voidreverse(short[] array)

Reverses the order of the given array.

voidreverse(char[] array)

Reverses the order of the given array.

voidreverse(byte[] array)

Reverses the order of the given array.

voidreverse(double[] array)

Reverses the order of the given array.

voidreverse(float[] array)

Reverses the order of the given array.

voidreverse(boolean[] array)

Reverses the order of the given array.

Object[]subarray(Object[] array, int startIndexInclusive, int endIndexExclusive)

Produces a new array containing the elements between the start and end indices.

long[]subarray(long[] array, int startIndexInclusive, int endIndexExclusive)

Produces a new long array containing the elements between the start and end indices.

int[]subarray(int[] array, int startIndexInclusive, int endIndexExclusive)

Produces a new int array containing the elements between the start and end indices.

short[]subarray(short[] array, int startIndexInclusive, int endIndexExclusive)

Produces a new short array containing the elements between the start and end indices.

char[]subarray(char[] array, int startIndexInclusive, int endIndexExclusive)

Produces a new char array containing the elements between the start and end indices.

byte[]subarray(byte[] array, int startIndexInclusive, int endIndexExclusive)

Produces a new byte array containing the elements between the start and end indices.

double[]subarray(double[] array, int startIndexInclusive, int endIndexExclusive)

Produces a new double array containing the elements between the start and end indices.

float[]subarray(float[] array, int startIndexInclusive, int endIndexExclusive)

Produces a new float array containing the elements between the start and end indices.

boolean[]subarray(boolean[] array, int startIndexInclusive, int endIndexExclusive)

Produces a new boolean array containing the elements between the start and end indices.

Character[]toObject(char[] array)

Converts an array of primitive chars to objects.

Long[]toObject(long[] array)

Converts an array of primitive longs to objects.

Integer[]toObject(int[] array)

Converts an array of primitive ints to objects.

Short[]toObject(short[] array)

Converts an array of primitive shorts to objects.

Byte[]toObject(byte[] array)

Converts an array of primitive bytes to objects.

Double[]toObject(double[] array)

Converts an array of primitive doubles to objects.

Float[]toObject(float[] array)

Converts an array of primitive floats to objects.

Boolean[]toObject(boolean[] array)

Converts an array of primitive booleans to objects.

char[]toPrimitive(Character[] array)

Converts an array of object Characters to primitives.

long[]toPrimitive(Long[] array)

Converts an array of object Longs to primitives.

int[]toPrimitive(Integer[] array)

Converts an array of object Integers to primitives.

short[]toPrimitive(Short[] array)

Converts an array of object Shorts to primitives.

byte[]toPrimitive(Byte[] array)

Converts an array of object Bytes to primitives.

double[]toPrimitive(Double[] array)

Converts an array of object Doubles to primitives.

float[]toPrimitive(Float[] array)

Converts an array of object Floats to primitives.

boolean[]toPrimitive(Boolean[] array)

Converts an array of object Booleans to primitives.

char[]toPrimitive(Character[] array, char valueForNull)

Converts an array of object Character to primitives handling null.

long[]toPrimitive(Long[] array, long valueForNull)

Converts an array of object Long to primitives handling null .

int[]toPrimitive(Integer[] array, int valueForNull)

Converts an array of object Integer to primitives handling null.

short[]toPrimitive(Short[] array, short valueForNull)

Converts an array of object Short to primitives handling null.

byte[]toPrimitive(Byte[] array, byte valueForNull)

Converts an array of object Bytes to primitives handling null.

double[]toPrimitive(Double[] array, double valueForNull)

Converts an array of object Doubles to primitives handling null.

float[]toPrimitive(Float[] array, float valueForNull)

Converts an array of object Floats to primitives handling null.

boolean[]toPrimitive(Boolean[] array, boolean valueForNull)

Converts an array of object Booleans to primitives handling null.

StringtoString(Object array)

Outputs an array as a String, treating null as an empty array.

StringtoString(Object array, String stringIfNull)

Outputs an array as a String handling nulls.