01: // Copyright (c) 2001 Per M.A. Bothner and Brainfood Inc.
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.lists;
05:
06: /** General interface to arrays of arbitrary dimension. */
07:
08: public interface Array {
09: public boolean isEmpty();
10:
11: /**
12: * Get the rank (number of dimensions) of this array.
13: * The rank of a scalar is 0, of a Sequence is 1, of a matrix is 2, etc.
14: */
15: public int rank();
16:
17: public int getEffectiveIndex(int[] indexes);
18:
19: public Object get(int[] indexes);
20:
21: public Object set(int[] indexes, Object value);
22:
23: public Object getRowMajor(int index);
24:
25: //public void setRowMajor(int index, Object value);
26:
27: /** Get the least dimension along the specified dimension. */
28: public int getLowBound(int dim);
29:
30: /** Get length along specified dimension. */
31: public int getSize(int dim);
32:
33: public Array transpose(int[] lowBounds, int[] dimensions,
34: int offset0, int[] factors);
35: }
|