* @return the concatenation of the two arrays, or null if the two arrays
* are null.
*/
- public static final char[][] arrayConcat(char[][] first, char[][] second) {
- if (first == null)
- return second;
- if (second == null)
- return first;
-
- int length1 = first.length;
- int length2 = second.length;
- char[][] result = new char[length1 + length2][];
- System.arraycopy(first, 0, result, 0, length1);
- System.arraycopy(second, 0, result, length1, length2);
- return result;
- }
+// public static final char[][] arrayConcat(char[][] first, char[][] second) {
+// if (first == null)
+// return second;
+// if (second == null)
+// return first;
+//
+// int length1 = first.length;
+// int length2 = second.length;
+// char[][] result = new char[length1 + length2][];
+// System.arraycopy(first, 0, result, 0, length1);
+// System.arraycopy(second, 0, result, length1, length2);
+// return result;
+// }
/**
* Answers a new array adding the second array at the end of first array. It
* separator between each part and appending the given name at the
* end
*/
- public static final char[] concatWith(char[] name, char[][] array,
- char separator) {
- int nameLength = name == null ? 0 : name.length;
- if (nameLength == 0)
- return concatWith(array, separator);
-
- int length = array == null ? 0 : array.length;
- if (length == 0)
- return name;
-
- int size = nameLength;
- int index = length;
- while (--index >= 0)
- if (array[index].length > 0)
- size += array[index].length + 1;
- char[] result = new char[size];
- index = size;
- for (int i = length - 1; i >= 0; i--) {
- int subLength = array[i].length;
- if (subLength > 0) {
- index -= subLength;
- System.arraycopy(array[i], 0, result, index, subLength);
- result[--index] = separator;
- }
- }
- System.arraycopy(name, 0, result, 0, nameLength);
- return result;
- }
+// public static final char[] concatWith(char[] name, char[][] array,
+// char separator) {
+// int nameLength = name == null ? 0 : name.length;
+// if (nameLength == 0)
+// return concatWith(array, separator);
+//
+// int length = array == null ? 0 : array.length;
+// if (length == 0)
+// return name;
+//
+// int size = nameLength;
+// int index = length;
+// while (--index >= 0)
+// if (array[index].length > 0)
+// size += array[index].length + 1;
+// char[] result = new char[size];
+// index = size;
+// for (int i = length - 1; i >= 0; i--) {
+// int subLength = array[i].length;
+// if (subLength > 0) {
+// index -= subLength;
+// System.arraycopy(array[i], 0, result, index, subLength);
+// result[--index] = separator;
+// }
+// }
+// System.arraycopy(name, 0, result, 0, nameLength);
+// return result;
+// }
/**
* Answers the concatenation of the given array parts using the given
* @return true if the array contains an occurrence of character, false
* otherwise.
*/
- public static final boolean contains(char character, char[][] array) {
- for (int i = array.length; --i >= 0;) {
- char[] subarray = array[i];
- for (int j = subarray.length; --j >= 0;)
- if (subarray[j] == character)
- return true;
- }
- return false;
- }
+// public static final boolean contains(char character, char[][] array) {
+// for (int i = array.length; --i >= 0;) {
+// char[] subarray = array[i];
+// for (int j = subarray.length; --j >= 0;)
+// if (subarray[j] == character)
+// return true;
+// }
+// return false;
+// }
/**
* Answers true if the array contains an occurrence of character, false
* @return true if the two arrays are identical character by character
* according to the value of isCaseSensitive, otherwise false
*/
- public static final boolean equals(char[][] first, char[][] second,
- boolean isCaseSensitive) {
-
- if (isCaseSensitive) {
- return equals(first, second);
- }
- if (first == second)
- return true;
- if (first == null || second == null)
- return false;
- if (first.length != second.length)
- return false;
-
- for (int i = first.length; --i >= 0;)
- if (!equals(first[i], second[i], false))
- return false;
- return true;
- }
+// public static final boolean equals(char[][] first, char[][] second,
+// boolean isCaseSensitive) {
+//
+// if (isCaseSensitive) {
+// return equals(first, second);
+// }
+// if (first == second)
+// return true;
+// if (first == null || second == null)
+// return false;
+// if (first.length != second.length)
+// return false;
+//
+// for (int i = first.length; --i >= 0;)
+// if (!equals(first[i], second[i], false))
+// return false;
+// return true;
+// }
/**
* Answers true if the two arrays are identical character by character,
* @exception ArrayIndexOutOfBoundsException
* if start is lower than 0
*/
- public static final int occurencesOf(char toBeFound, char[] array, int start) {
- int count = 0;
- for (int i = start; i < array.length; i++)
- if (toBeFound == array[i])
- count++;
- return count;
- }
+// public static final int occurencesOf(char toBeFound, char[] array, int start) {
+// int count = 0;
+// for (int i = start; i < array.length; i++)
+// if (toBeFound == array[i])
+// count++;
+// return count;
+// }
/**
* Answers true if the given name starts with the given prefix, false
* @exception NullPointerException
* if the given name is null or if the given prefix is null
*/
- public static final boolean prefixEquals(char[] prefix, char[] name,
- boolean isCaseSensitive) {
-
- int max = prefix.length;
- if (name.length < max)
- return false;
- if (isCaseSensitive) {
- for (int i = max; --i >= 0;)
- // assumes the prefix is not larger than the name
- if (prefix[i] != name[i])
- return false;
- return true;
- }
-
- for (int i = max; --i >= 0;)
- // assumes the prefix is not larger than the name
- if (Character.toLowerCase(prefix[i]) != Character
- .toLowerCase(name[i]))
- return false;
- return true;
- }
+// public static final boolean prefixEquals(char[] prefix, char[] name,
+// boolean isCaseSensitive) {
+//
+// int max = prefix.length;
+// if (name.length < max)
+// return false;
+// if (isCaseSensitive) {
+// for (int i = max; --i >= 0;)
+// // assumes the prefix is not larger than the name
+// if (prefix[i] != name[i])
+// return false;
+// return true;
+// }
+//
+// for (int i = max; --i >= 0;)
+// // assumes the prefix is not larger than the name
+// if (Character.toLowerCase(prefix[i]) != Character
+// .toLowerCase(name[i]))
+// return false;
+// return true;
+// }
/**
* Replace all occurrence of the character to be replaced with the