Opus5
Class Bounds

java.lang.Object
  |
  +--Opus5.Bounds

public class Bounds
extends java.lang.Object

Provides one static method to simplify array-bounds checking.

Version:
$Id: Bounds.java,v 3.1 1998/07/28 01:32:17 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.

Constructor Summary
Bounds()
           
 
Method Summary
static void check(int i, int base, int length)
          Checks whether the specified index falls in the specified range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bounds

public Bounds()
Method Detail

check

public static void check(int i,
                         int base,
                         int length)
Checks whether the specified index falls in the specified range. Specifically, this method tests whether base <= i < (base+length).
Parameters:
i - The index to check.
base - The smallest valid index.
length - The range of values allowed.
Throws:
java.lang.IndexOutOfBoundsException - If the index is out of bounds.