KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > lists > Array


1 // Copyright (c) 2001 Per M.A. Bothner and Brainfood Inc.
2
// This is free software; for terms and warranty disclaimer see ./COPYING.
3

4 package gnu.lists;
5
6 /** General interface to arrays of arbitrary dimension. */
7
8 public interface Array
9 {
10   public boolean isEmpty();
11
12   /**
13    * Get the rank (number of dimensions) of this array.
14    * The rank of a scalar is 0, of a Sequence is 1, of a matrix is 2, etc.
15    */

16   public int rank();
17
18   public int getEffectiveIndex(int[] indexes);
19
20   public Object JavaDoc get(int[] indexes);
21
22   public Object JavaDoc set(int[] indexes, Object JavaDoc value);
23
24   public Object JavaDoc getRowMajor(int index);
25
26   //public void setRowMajor(int index, Object value);
27

28   /** Get the least dimension along the specified dimension. */
29   public int getLowBound(int dim);
30
31   /** Get length along specified dimension. */
32   public int getSize(int dim);
33
34   public Array transpose(int[] lowBounds, int[] dimensions,
35              int offset0, int[] factors);
36 }
37
Popular Tags