@Override protected String toString(Object array, int index) { return ForNonArrayType.LONG.toString(Array.getLong(array, index)); } },
protected String arrayToString(Object o) { int len = Array.getLength(o); Class c = o.getClass().getComponentType(); String res = "[ "; for (int i = 0; i < len; i++) { if ( c == byte.class ) res+=Array.getByte(o,i); if ( c == boolean.class ) res+=Array.getBoolean(o, i); if ( c == char.class ) res+=Array.getChar(o, i); if ( c == short.class ) res+=Array.getShort(o, i); if ( c == int.class ) res+=Array.getInt(o, i); if ( c == long.class ) res+=Array.getLong(o, i); if ( c == float.class ) res+=Array.getFloat(o, i); if ( c == double.class ) res+=Array.getDouble(o, i); if ( i < len-1) res+=","; } res += " ]"; return res; }
if (i != 0) string.append(' '); string.append(Array.getLong(o, i));
protected String arrayToString(Object o) { int len = Array.getLength(o); Class c = o.getClass().getComponentType(); String res = "[ "; for (int i = 0; i < len; i++) { if ( c == byte.class ) res+=Array.getByte(o,i); if ( c == boolean.class ) res+=Array.getBoolean(o, i); if ( c == char.class ) res+=Array.getChar(o, i); if ( c == short.class ) res+=Array.getShort(o, i); if ( c == int.class ) res+=Array.getInt(o, i); if ( c == long.class ) res+=Array.getLong(o, i); if ( c == float.class ) res+=Array.getFloat(o, i); if ( c == double.class ) res+=Array.getDouble(o, i); if ( i < len-1) res+=","; } res += " ]"; return res; }
writeRawInt(type, Array.getBoolean(primitiveArray, i) ? 1 : 0); else writeRawInt(type, Array.getLong(primitiveArray, i));
writeRawInt(type, Array.getBoolean(primitiveArray, i) ? 1 : 0); else writeRawInt(type, Array.getLong(primitiveArray, i));
private void assertNumericArrayHeaderAndContent( Object array, PropertyType type, int expectedBitsUsedPerItem, Pair<byte[],byte[]> loadedBytesFromStore ) { assertArrayHeader( loadedBytesFromStore.first(), type, expectedBitsUsedPerItem ); Bits bits = Bits.bitsFromBytes( loadedBytesFromStore.other() ); int length = Array.getLength( array ); for ( int i = 0; i < length; i++ ) { if ( array instanceof double[] ) { assertEquals( Double.doubleToLongBits( Array.getDouble( array, i ) ), bits.getLong( expectedBitsUsedPerItem ) ); } else { assertEquals( Array.getLong( array, i ), bits.getLong( expectedBitsUsedPerItem ) ); } } }
public Object get(Object array, int index) { return java.lang.reflect.Array.getLong(array, index); } };
@Override public Object get(Object array, int index) { return Array.getLong(array, index); }
public Object get(Object array, int index) { return java.lang.reflect.Array.getLong(array, index); } };
/** * Returns a {@linkplain Range#getMinValue() range minimum value} as a {@code long}. * The {@code index} can be any value from 0 inclusive to the set {@link #size() size} * exclusive. The returned values always increase with {@code index}. * Widening conversions are performed as needed. * * @param index the range index, from 0 inclusive to {@link #size() size} exclusive. * @return the minimum value for the range at the specified index, inclusive. * @throws IndexOutOfBoundsException if {@code index} is out of bounds. * @throws ClassCastException if range elements are not convertible to {@code long}. */ public long getMinLong(int index) throws IndexOutOfBoundsException, ClassCastException { if ((index *= 2) >= length) { throw new IndexOutOfBoundsException(); } return Array.getLong(array, index); }
/** * Returns a {@linkplain Range#getMinValue() range minimum value} as a {@code long}. * The {@code index} can be any value from 0 inclusive to the set {@link #size() size} * exclusive. The returned values always increase with {@code index}. * Widening conversions are performed as needed. * * @param index the range index, from 0 inclusive to {@link #size() size} exclusive. * @return the minimum value for the range at the specified index, inclusive. * @throws IndexOutOfBoundsException if {@code index} is out of bounds. * @throws ClassCastException if range elements are not convertible to {@code long}. */ public long getMinLong(int index) throws IndexOutOfBoundsException, ClassCastException { if ((index *= 2) >= length) { throw new IndexOutOfBoundsException(); } return Array.getLong(array, index); }
private static long[] widenToUnsigned(final Object array) { final Class<?> componentType = array.getClass().getComponentType(); final long mask; if (componentType == Byte.TYPE) mask = 0xffL; else if (componentType == Short.TYPE) mask = 0xffffL; else if (componentType == Integer.TYPE) mask = 0xffffffffL; else throw new IllegalArgumentException("Unrecognized unsigned array type " + componentType); final long[] ret = new long[Array.getLength(array)]; for (int i = 0; i < ret.length; ++i) { ret[i] = Array.getLong(array, i) & mask; } return ret; }
private long[] widenToUnsigned(final Object array) { final Class<?> componentType = array.getClass().getComponentType(); final long mask; if (componentType == Byte.TYPE) mask = 0xffL; else if (componentType == Short.TYPE) mask = 0xffffL; else if (componentType == Integer.TYPE) mask = 0xffffffffL; else throw new IllegalArgumentException("Unrecognized unsigned array type " + componentType); final long[] ret = new long[Array.getLength(array)]; for (int i = 0; i < ret.length; ++i) { ret[i] = Array.getLong(array, i) & mask; } return ret; }
private static long[] widenToUnsigned(final Object array) { final Class<?> componentType = array.getClass().getComponentType(); final long mask; if (componentType == Byte.TYPE) mask = 0xffL; else if (componentType == Short.TYPE) mask = 0xffffL; else if (componentType == Integer.TYPE) mask = 0xffffffffL; else throw new IllegalArgumentException("Unrecognized unsigned array type " + componentType); final long[] ret = new long[Array.getLength(array)]; for (int i = 0; i < ret.length; ++i) { ret[i] = Array.getLong(array, i) & mask; } return ret; }
private long[] widenToUnsigned(final Object array) { final Class<?> componentType = array.getClass().getComponentType(); final long mask; if (componentType == Byte.TYPE) mask = 0xffL; else if (componentType == Short.TYPE) mask = 0xffffL; else if (componentType == Integer.TYPE) mask = 0xffffffffL; else throw new IllegalArgumentException("Unrecognized unsigned array type " + componentType); final long[] ret = new long[Array.getLength(array)]; for (int i = 0; i < ret.length; ++i) { ret[i] = Array.getLong(array, i) & mask; } return ret; }
@Override protected String toString(Object array, int index) { return ForNonArrayType.LONG.toString(Array.getLong(array, index)); } },
/** * @throws IOException * @see org.apache.wicket.util.io.ClassStreamHandler.PrimitiveArray#writeArray(Object, * WicketObjectOutputStream) */ public void writeArray(Object object, WicketObjectOutputStream dos) throws IOException { int length = Array.getLength(object); dos.writeInt(length); for (int i = 0; i < length; i++) { dos.writeLong(Array.getLong(object, i)); } }
/** * @throws IOException * @see org.apache.wicket.util.io.ClassStreamHandler.PrimitiveArray#writeArray(Object, * WicketObjectOutputStream) */ @Override public void writeArray(Object object, WicketObjectOutputStream dos) throws IOException { int length = Array.getLength(object); dos.writeInt(length); for (int i = 0; i < length; i++) { dos.writeLong(Array.getLong(object, i)); } }
@JTranscSync public static Object get(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException { Type elementType = getArrayElementType(array.getClass()); if (elementType == Boolean.TYPE) return getBoolean(array, index); if (elementType == Byte.TYPE) return getByte(array, index); if (elementType == Character.TYPE) return getChar(array, index); if (elementType == Short.TYPE) return getShort(array, index); if (elementType == Integer.TYPE) return getInt(array, index); if (elementType == Long.TYPE) return getLong(array, index); if (elementType == Float.TYPE) return getFloat(array, index); if (elementType == Double.TYPE) return getDouble(array, index); return getInstance(array, index); }