jal.floats
Class Range

java.lang.Object
  extended byjal.floats.Range

public final class Range
extends Object

A range of values within an array, consisting of the array, the index of the first element in the range, and an index one past the range. The notation is [first, last), indicating that array[first] is part of the range but array[last] is not. The range [n, n) is a valid range that contains zero elements, while the range [n, n-1) is invalid.

Note that operations on a Range object do not actually change any array elements. A Range is simply a way of describing a set of values.

Copyright © 1996 Silicon Graphics, Inc.
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Silicon Graphics makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.

Author:
Matthew Austern (austern@mti.sgi.com), Alexander Stepanov (stepanov@mti.sgi.com)

Field Summary
 float[] array
          Array containing the range.
 int first
          Index of the first element in the range.
 int last
          Index that is one past the last element in the range.
 
Constructor Summary
Range(float[] array)
          Constructs a Range that represents an entire array.
Range(float[] array, int first, int last)
          Constructs a Range.
 
Method Summary
 String toString()
          Creates a string representation of this Range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

array

public float[] array
Array containing the range.


first

public int first
Index of the first element in the range.


last

public int last
Index that is one past the last element in the range.

Constructor Detail

Range

public Range(float[] array,
             int first,
             int last)
Constructs a Range.

Parameters:
array - Array containing the range
first - Index of the first element in the range
last - Index that is one past the last element in the range

Range

public Range(float[] array)
Constructs a Range that represents an entire array. Equivalent to Range(array, 0, array.length).

Parameters:
array - Array containing the range
Method Detail

toString

public String toString()
Creates a string representation of this Range.

Returns:
A string of the form "[first, last)".