From b04e96dc27733d76dd1a4f68dcd628eba1879ae9 Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 6 Sep 2006 00:02:37 +0000 Subject: [PATCH] Now (actually, a while back...) that the Object[] version of splice is genericized, we don't need a separate version for String[]. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1899 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/ArrayUtil.java | 57 --------------------- 1 file changed, 57 deletions(-) diff --git a/src/java/com/samskivert/util/ArrayUtil.java b/src/java/com/samskivert/util/ArrayUtil.java index 9568e291..a4f5a4c2 100644 --- a/src/java/com/samskivert/util/ArrayUtil.java +++ b/src/java/com/samskivert/util/ArrayUtil.java @@ -546,63 +546,6 @@ public class ArrayUtil return nvalues; } - /** - * Creates and returns a new array sized to fit and populated with the - * subset of values from indexes 0 to offset - - * 1 (inclusive) in the supplied array. - * - * @param values the array of values to splice. - * @param offset the index within the values array after - * which all subsequent values are to be removed. This must be a - * valid index within the values array. - */ - public static String[] splice (String[] values, int offset) - { - int length = (values == null) ? 0 : values.length - offset; - return splice(values, offset, length); - } - - /** - * Creates and returns a new array sized to fit and populated with the - * concatenated subset of values from indexes 0 to - * offset - 1, and offset + length to - * values.length (inclusive) in the supplied array. - * - * @param values the array of values to splice. - * @param offset the index within the values array at - * which the first element will be removed. This must be a valid - * index within the values array. - * @param length the number of elements to be removed. Note that - * offset + length must be a valid index within the - * values array. - */ - public static String[] splice (String[] values, int offset, int length) - { - // make sure we've something to work with - if (values == null) { - throw new IllegalArgumentException("Can't splice a null array."); - - } else if (length == 0) { - // we're not splicing anything! - return values; - } - - // require that the entire range to remove be within the array bounds - int size = values.length; - int tstart = offset + length; - if (offset < 0 || tstart > size) { - throw new ArrayIndexOutOfBoundsException( - "Splice range out of bounds [offset=" + offset + - ", length=" + length + ", size=" + size + "]."); - } - - // create a new array and populate it with the spliced-in values - String[] nvalues = new String[size - length]; - System.arraycopy(values, 0, nvalues, 0, offset); - System.arraycopy(values, tstart, nvalues, offset, size - tstart); - return nvalues; - } - /** * Creates and returns a new array sized to fit and populated with the * subset of values from indexes 0 to offset -