/** * Appends an element to <code>float</code> array. */ public static float[] append(float[] buffer, float newElement) { float[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>double</code> array. */ public static double[] append(double[] buffer, double newElement) { double[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to array. */ public static <T> T[] append(T[] buffer, T newElement) { T[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>byte</code> array. */ public static byte[] append(byte[] buffer, byte newElement) { byte[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>boolean</code> array. */ public static boolean[] append(boolean[] buffer, boolean newElement) { boolean[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>String</code> array. */ public static String[] append(String[] buffer, String newElement) { String[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>short</code> array. */ public static short[] append(short[] buffer, short newElement) { short[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>char</code> array. */ public static char[] append(char[] buffer, char newElement) { char[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>int</code> array. */ public static int[] append(int[] buffer, int newElement) { int[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>long</code> array. */ public static long[] append(long[] buffer, long newElement) { long[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to array. */ public static <T> T[] append(T[] buffer, T newElement) { T[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>short</code> array. */ public static short[] append(short[] buffer, short newElement) { short[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>long</code> array. */ public static long[] append(long[] buffer, long newElement) { long[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>String</code> array. */ public static String[] append(String[] buffer, String newElement) { String[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>byte</code> array. */ public static byte[] append(byte[] buffer, byte newElement) { byte[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>char</code> array. */ public static char[] append(char[] buffer, char newElement) { char[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
/** * Appends an element to <code>float</code> array. */ public static float[] append(float[] buffer, float newElement) { float[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
private void ensureCapacity() { if (textLen == text.length) { text = ArraysUtil.resize(text, textLen << 1); } }
/** * Appends an element to <code>int</code> array. */ public static int[] append(int[] buffer, int newElement) { int[] t = resize(buffer, buffer.length + 1); t[buffer.length] = newElement; return t; }
private void ensureCapacity(final int growth) { int desiredLen = textLen + growth; if (desiredLen > text.length) { text = ArraysUtil.resize(text, Math.max(textLen << 1, desiredLen)); } }