Package com.reportmill.base
Class RMArrayUtils
java.lang.Object
com.reportmill.base.RMArrayUtils
A collection of array utility methods.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic char[]add(char[] array, char value) Adds a char value to a char array.static char[]add(char[] array, char value, int index) Adds a char value to a char array at the given index.static int[]add(int[] array, int value) Adds an int value to an int array.static int[]add(int[] array, int value, int index) Adds an int value to an int array at the given index.static int[]addIfAbsent(int[] array, int value) Adds an int value to an int array at the given index if value is absent from array.static boolean[]clone(boolean[] array) Clones a boolean array.static byte[]clone(byte[] array) Clones a byte array.static float[]clone(float[] array) Clones a float array.static int[]clone(int[] array) Clones an int array.static booleanReturns whether the given array contains the given object.static booleancontainsIC(Object[] anArray, Object anObj) Returns whether the given array contains the given object (assuming strings and case insensitive).static booleanequals(byte[] array1, byte[] array2) Returns whether two byte arrays are equal.static booleanequals(byte[] array1, byte[] array2, int length) Returns whether two byte arrays are equal to the given length.static booleanequals(float[] array1, float[] array2) Returns whether two float arrays are equal.static booleanequals(int[] array1, int[] array2) Returns whether two boolean arrays are equal.static intReturns the index of the given object in the given array.static intReturns the index of the given object in the given array (assuming strings and ignoring case).static byte[]realloc(byte[] array, int size) Creates a new byte array with original values and new size.static int[]realloc(int[] array, int size) Creates a new int array with original values and new size.static Object[]Creates a new object array with original values and new size.static int[]remove(int[] a, int anIndex) Removes an int value from an int array.static int[]remove(int[] a, int start, int end) Removes a range of values from an int array.static int[]replace(int[] array, int start, int end, int[] replacement) Replaces a range of values in an int array with values from another int array.
- 
Constructor Details- 
RMArrayUtilspublic RMArrayUtils()
 
- 
- 
Method Details- 
addpublic static char[] add(char[] array, char value) Adds a char value to a char array.
- 
addpublic static char[] add(char[] array, char value, int index) Adds a char value to a char array at the given index.
- 
addpublic static int[] add(int[] array, int value) Adds an int value to an int array.
- 
addpublic static int[] add(int[] array, int value, int index) Adds an int value to an int array at the given index.
- 
addIfAbsentpublic static int[] addIfAbsent(int[] array, int value) Adds an int value to an int array at the given index if value is absent from array.
- 
removepublic static int[] remove(int[] a, int anIndex) Removes an int value from an int array.
- 
removepublic static int[] remove(int[] a, int start, int end) Removes a range of values from an int array.
- 
replacepublic static int[] replace(int[] array, int start, int end, int[] replacement) Replaces a range of values in an int array with values from another int array.
- 
clonepublic static byte[] clone(byte[] array) Clones a byte array.
- 
clonepublic static boolean[] clone(boolean[] array) Clones a boolean array.
- 
clonepublic static int[] clone(int[] array) Clones an int array.
- 
clonepublic static float[] clone(float[] array) Clones a float array.
- 
reallocpublic static byte[] realloc(byte[] array, int size) Creates a new byte array with original values and new size.
- 
reallocpublic static int[] realloc(int[] array, int size) Creates a new int array with original values and new size.
- 
reallocCreates a new object array with original values and new size.
- 
equalspublic static boolean equals(byte[] array1, byte[] array2) Returns whether two byte arrays are equal.
- 
equalspublic static boolean equals(byte[] array1, byte[] array2, int length) Returns whether two byte arrays are equal to the given length.
- 
equalspublic static boolean equals(int[] array1, int[] array2) Returns whether two boolean arrays are equal.
- 
equalspublic static boolean equals(float[] array1, float[] array2) Returns whether two float arrays are equal.
- 
indexOfReturns the index of the given object in the given array.
- 
indexOfICReturns the index of the given object in the given array (assuming strings and ignoring case).
- 
containsReturns whether the given array contains the given object.
- 
containsICReturns whether the given array contains the given object (assuming strings and case insensitive).
 
-