Package dafny
Class Array<T>
java.lang.Object
dafny.Array<T>
- Type Parameters:
T- The type of the elements in the array, or if that type is primitive, the boxed version of that type (e.g.,Integerfor int).
- All Implemented Interfaces:
Cloneable
A wrapper for an array that may be of primitive type. Essentially acts as
one "big box" for many primitives, as an alternative to putting each in their
own box. Much faster than using
Array operations
to operate on possibly-primitive arrays.
This isn't used by generated Dafny code, which directly uses values of type
Object when the element type isn't known, relying on a TypeDescriptor passed
in. It's much more pleasant to use, and more type-safe, than the bare
TypeDescriptor operations, however, so extern implementors may be interested.
It is also used to implement DafnySequence.-
Method Summary
Modifier and TypeMethodDescriptioncopy()voidcopyOfRange(int lo, int hi) booleandeepEquals(Array<T> other) voidstatic <T> Array<T>fromList(TypeDescriptor<T> eltType, List<T> elements) get(int index) intlength()static <T> Array<T>newArray(TypeDescriptor<T> eltType, int length) voidunwrap()static Objectstatic boolean[]unwrapBooleans(Array<Boolean> array) static byte[]unwrapBytes(Array<Byte> array) static char[]unwrapChars(Array<Character> array) static int[]unwrapInts(Array<Integer> array) static long[]unwrapLongs(Array<Long> array) static <T> T[]unwrapObjects(Array<T> array) static short[]unwrapShorts(Array<Short> array) wrap(boolean[] array) wrap(byte[] array) wrap(char[] array) wrap(int[] array) wrap(long[] array) wrap(short[] array) static <T> Array<T>wrap(TypeDescriptor<T> eltType, Object array) static <T> Array<T>wrap(TypeDescriptor<T> eltType, T[] array)
-
Method Details
-
newArray
-
fromList
-
elementType
-
unwrap
-
get
-
set
-
length
public int length() -
fill
-
copy
-
copy
-
copyOfRange
-
deepEquals
-
wrap
-
wrap
-
wrap
-
wrap
-
wrap
-
wrap
-
wrap
-
wrap
-
unwrap
-
unwrapObjects
-
unwrapBytes
-
unwrapShorts
-
unwrapInts
-
unwrapLongs
-
unwrapBooleans
-
unwrapChars
-