public static int[] toCodepointArray( ceylon.language.List<? extends ceylon.language.Character> sequence, int... initialElements) { int[] ret = new int[(int) sequence.getSize() + initialElements.length]; int i = 0; for (; i < initialElements.length; i++) { ret[i] = initialElements[i]; } while (!sequence.getEmpty()) { ret[i++] = sequence.getFirst().intValue(); sequence = (ceylon.language.List<? extends ceylon.language.Character>) sequence.getRest(); } return ret; }
public static double[] toDoubleArray( ceylon.language.List<? extends ceylon.language.Float> sequence, double... initialElements) { double[] ret = new double[(int) sequence.getSize() + initialElements.length]; int i = 0; for (; i < initialElements.length; i++) { ret[i] = initialElements[i]; } while (!sequence.getEmpty()) { ret[i++] = sequence.getFirst().doubleValue(); sequence = (ceylon.language.List<? extends ceylon.language.Float>) sequence.getRest(); } return ret; }
public static long[] toLongArray( ceylon.language.List<? extends ceylon.language.Integer> sequence, long... initialElements) { long[] ret = new long[(int) sequence.getSize() + initialElements.length]; int i = 0; for (; i < initialElements.length; i++) { ret[i] = initialElements[i]; } while (!sequence.getEmpty()) { ret[i++] = sequence.getFirst().longValue(); sequence = (ceylon.language.List<? extends ceylon.language.Integer>) sequence.getRest(); } return ret; }
public static byte[] toByteArray( ceylon.language.List<? extends ceylon.language.Integer> sequence, long... initialElements) { byte[] ret = new byte[initialElements.length + (int) sequence.getSize()]; int i = 0; for (; i < initialElements.length; i++) { ret[i] = (byte) initialElements[i]; } while (!sequence.getEmpty()) { ret[i++] = (byte) sequence.getFirst().longValue(); sequence = (ceylon.language.List<? extends ceylon.language.Integer>) sequence.getRest(); } return ret; }
public static char[] toCharArray( ceylon.language.List<? extends ceylon.language.Character> sequence, int... initialElements) { char[] ret = new char[(int) sequence.getSize() + initialElements.length]; int i = 0; // FIXME: this is invalid and should yield a larger array by splitting chars > 16 bits in two for (; i < initialElements.length; i++) { ret[i] = (char) initialElements[i]; } while (!sequence.getEmpty()) { ret[i++] = (char) sequence.getFirst().intValue(); sequence = (ceylon.language.List<? extends ceylon.language.Character>) sequence.getRest(); } return ret; }
public static boolean[] toBooleanArray( ceylon.language.List<? extends ceylon.language.Boolean> sequence, boolean... initialElements) { boolean[] ret = new boolean[(int) sequence.getSize() + initialElements.length]; int i = 0; for (; i < initialElements.length; i++) { ret[i] = initialElements[i]; } while (!sequence.getEmpty()) { ret[i++] = sequence.getFirst().booleanValue(); sequence = (ceylon.language.List<? extends ceylon.language.Boolean>) sequence.getRest(); } return ret; }
public static java.lang.String[] toJavaStringArray( ceylon.language.List<? extends ceylon.language.String> sequence, java.lang.String... initialElements) { java.lang.String[] ret = new java.lang.String[(int) sequence.getSize() + initialElements.length]; int i = 0; for (; i < initialElements.length; i++) { ret[i] = initialElements[i]; } while (!sequence.getEmpty()) { ret[i++] = sequence.getFirst().toString(); sequence = (ceylon.language.List<? extends ceylon.language.String>) sequence.getRest(); } return ret; }