public static int lengthOf(Object obj) { return len(obj); }
public static int lengthOf(Object obj) { return len(obj); }
@SuppressWarnings({"rawtypes", "unchecked"}) public static Set toSet(Object value) { if (value instanceof Set) { return (Set) value; } else if (value instanceof Collection) { return new HashSet((Collection) value); } else { HashSet set = new HashSet(len(value)); Iterator<Object> iterator = iterator(Typ.object, value); while (iterator.hasNext()) { set.add(iterator.next()); } return set; } }
@SuppressWarnings({"rawtypes", "unchecked"}) public static Set toSet(Object value) { if (value instanceof Set) { return (Set) value; } else if (value instanceof Collection) { return new HashSet((Collection) value); } else { HashSet set = new HashSet(len(value)); Iterator<Object> iterator = iterator(Typ.object, value); while (iterator.hasNext()) { set.add(iterator.next()); } return set; } }
public static Collection toCollection(Object value) { if (value instanceof Collection) { return (Collection) value; } else if (value == null) { return new ArrayList(); } else if (value instanceof Map) { return ((Map) value).entrySet(); } else { ArrayList list = new ArrayList(len(value)); Iterator<Object> iterator = iterator(Typ.object, value); while (iterator.hasNext()) { list.add(iterator.next()); } return list; } }
public static Collection toCollection(Object value) { if (value instanceof Collection) { return (Collection) value; } else if (value == null) { return new ArrayList(); } else if (value instanceof Map) { return ((Map)value).entrySet(); } else { ArrayList list = new ArrayList(len(value)); Iterator<Object> iterator = iterator(Typ.object, value); while (iterator.hasNext()) { list.add(iterator.next()); } return list; } }
public static short[] sarray(Object value) { //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently if (value.getClass() == Typ.shortArray) { return (short[]) value; } short[] values = new short[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toShort(iterator.next()); index++; } return values; }
public static double[] darray(Object value) { //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently if (value.getClass() == Typ.doubleArray) { return (double[]) value; } double[] values = new double[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toFloat(iterator.next()); index++; } return values; }
public static float[] farray(Object value) { //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently if (value.getClass() == Typ.floatArray) { return (float[]) value; } float[] values = new float[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toFloat(iterator.next()); index++; } return values; }
public static long[] larray(Object value) { //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently if (value.getClass() == Typ.shortArray) { return (long[]) value; } long[] values = new long[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toLong(iterator.next()); index++; } return values; }
public static double[] darray(Object value) { //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently if (value.getClass() == Typ.doubleArray) { return (double[]) value; } double[] values = new double[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toFloat(iterator.next()); index++; } return values; }
public static int[] iarray(Object value) { //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently if (value.getClass() == Typ.intArray) { return (int[]) value; } int[] values = new int[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toInt(iterator.next()); index++; } return values; }
public static char[] carray(Object value) { //You could handleUnexpectedException shorts, ints, longs and chars more efficiently if (value.getClass() == Typ.charArray) { return (char[]) value; } char[] values = new char[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Typ.object, value); while (iterator.hasNext()) { values[index] = toChar(iterator.next()); index++; } return values; }
public static char[] carray(Object value) { //You could handleUnexpectedException shorts, ints, longs and chars more efficiently if (value.getClass() == Typ.charArray) { return (char[]) value; } char[] values = new char[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Typ.object, value); while (iterator.hasNext()) { values[index] = toChar(iterator.next()); index++; } return values; }
public static long[] larray(Object value) { //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently if (value.getClass() == Typ.shortArray) { return (long[]) value; } long[] values = new long[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toLong(iterator.next()); index++; } return values; }
public static byte[] barray(Object value) { //You could handleUnexpectedException shorts, ints, longs and chars more efficiently if (value.getClass() == Typ.byteArray) { return (byte[]) value; } byte[] values = new byte[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toByte(iterator.next()); index++; } return values; }
public static short[] sarray(Object value) { //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently if (value.getClass() == Typ.shortArray) { return (short[]) value; } short[] values = new short[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toShort(iterator.next()); index++; } return values; }
public static int[] iarray(Object value) { //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently if (value.getClass() == Typ.intArray) { return (int[]) value; } int[] values = new int[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toInt(iterator.next()); index++; } return values; }
public static byte[] barray(Object value) { //You could handleUnexpectedException shorts, ints, longs and chars more efficiently if (value.getClass() == Typ.byteArray) { return (byte[]) value; } byte[] values = new byte[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toByte(iterator.next()); index++; } return values; }
public static float[] farray(Object value) { //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently if (value.getClass() == Typ.floatArray) { return (float[]) value; } float[] values = new float[len(value)]; int index = 0; Iterator<Object> iterator = iterator(Object.class, value); while (iterator.hasNext()) { values[index] = toFloat(iterator.next()); index++; } return values; }