cdm/src/main/java/ucar/ma2/Range.java
public int element(int i) throws InvalidRangeException {
    if (i < 0)
      throw new InvalidRangeException("i must be >= 0");
    if (i >= length)
      throw new InvalidRangeException("i must be < length");

    return first + i * stride;
  }
public int element(int i) throws InvalidRangeException {
    if (i < 0)
      throw new InvalidRangeException("i must be >= 0");
    if (i >= length)
      throw new InvalidRangeException("i must be < length");

    return first + i * stride;
  }
Get ith element

@param i index of the element
@return the i-th element of a range.
@throws InvalidRangeException i must be: 0 <= i < length