All Packages Class Hierarchy This Package Previous Next Index
Class array.Index
java.lang.Object
|
+----array.Index
- public final class Index
- extends Object
Index = represents an index set to arrays
Ranges provide the support to extract and operate on regular
array sections. Indexes provide similar support for irregular
sections.
It is not possible to define an array section using Indexes, but
one can use them in gather/scatter-like operations.
The only restriction is that elements in an Index must be nonnegative.
The same value can appear multiple times in an Index.
Indexes can be empty.
-
elements
-
-
theMax
-
-
theMin
-
-
Index(int[])
- Create an Index from a vector of ints.
-
Index(Range)
- Create and Index from a Range.
-
element(int)
- Return the i-th element of an Index.
-
elementf(int)
- Return the i-th element of an Index, no check.
-
length()
- Return the number of elements in an Index.
-
max()
- Return the largest element in an Index.
-
min()
- Return the smallest element in an Index.
-
toJava()
- Return an int[] with the elements of this Index.
elements
protected int elements[]
theMin
protected int theMin
theMax
protected int theMax
Index
public Index(int list[]) throws InvalidIndexException
- Create an Index from a vector of ints.
- Parameters:
- list - vector of int with list of elements
- Throws: InvalidIndexException
- elements must be nonnegative
Index
public Index(Range range)
- Create and Index from a Range. Note that a Range cannot have
negative elements.
- Parameters:
- range - Range describing elements
length
public int length()
- Return the number of elements in an Index.
element
public int element(int i) throws InvalidIndexElementException
- Return the i-th element of an Index.
- Parameters:
- i - index of the element
- Throws: InvalidIndexElementException
- 0 <= i < Index.length()
elementf
protected int elementf(int i)
- Return the i-th element of an Index, no check.
- Parameters:
- i - index of the element
min
public int min()
- Return the smallest element in an Index.
max
public int max()
- Return the largest element in an Index.
toJava
public int[] toJava()
- Return an int[] with the elements of this Index.
All Packages Class Hierarchy This Package Previous Next Index