All Packages Class Hierarchy This Package Previous Next Index
Class array.Range
java.lang.Object
|
+----array.Range
- public final class Range
- extends Object
Range = represents a range of integers, used as an index set to arrays
To extract array sections from arrays, it is necessary to define
ranges of indices along axes of arrays. Range objects are used for
that purpose.
Ranges are either monotonically increasing or monotonically decreasing.
Elements must be nonnegative. Ranges can be empty.
-
a
-
-
d
-
-
n
-
-
Range(int, int)
- Create a range with unit stride (+1 or -1).
-
Range(int, int, int)
- Create a range with a specified stride.
-
element(int)
- Return the i-th element of a range.
-
elementf(int)
- Return the i-th element of a range, no check
-
first()
-
-
last()
-
-
length()
- Return the number of elements in a range.
-
max()
-
-
min()
-
-
step()
-
n
protected int n
a
protected int a
d
protected int d
Range
public Range(int first,
int last) throws InvalidRangeException
- Create a range with unit stride (+1 or -1).
- Parameters:
- first - first value in range
- last - last value in range
- Throws: InvalidRangeException
- elements must be nonnegative
Range
public Range(int first,
int last,
int step) throws InvalidRangeException
- Create a range with a specified stride.
- Parameters:
- first - first value in range
- last - last value in range
- step - stride between consecutive elements (positive or negative)
- Throws: InvalidRangeException
- elements must be nonnegative
length
public int length()
- Return the number of elements in a range.
element
public int element(int i) throws InvalidRangeElementException
- Return the i-th element of a range.
- Parameters:
- i - index of the element
- Throws: InvalidRangeElementException
- 0 <= i < length
elementf
protected int elementf(int i)
- Return the i-th element of a range, no check
- Parameters:
- i - index of the element
first
public int first()
last
public int last()
step
public int step()
min
public int min()
max
public int max()
All Packages Class Hierarchy This Package Previous Next Index