All Packages Class Hierarchy This Package Previous Next Index
Class att.grappa.IntPairs
java.lang.Object
|
+----att.grappa.IntPairs
- public class IntPairs
- extends Object
A class for storing pairs of int arrays.
- Version:
- 1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
- Author:
- John Mocenigo, Research @ AT&T Labs
-
xArray
- The x array.
-
yArray
- The y array.
-
IntPairs(int)
- Constructs and initializes an
IntPairs
instance
with the given size for its arrays.
-
addPair(int, int)
- Adds a pair of integers just beyond the last occupied slot in the arrays.
-
insertPairAt(int, int, int)
- Adds a pair of integers at the specified location.
-
size()
- Get the size of the arrays in this object.
xArray
public int xArray[]
- The x array.
yArray
public int yArray[]
- The y array.
IntPairs
public IntPairs(int size)
- Constructs and initializes an
IntPairs
instance
with the given size for its arrays.
- Parameters:
- size - the size of each of the two
IntPairs
arrays
size
public int size()
- Get the size of the arrays in this object.
- Returns:
- the arrays' size
insertPairAt
public void insertPairAt(int x,
int y,
int n) throws ArrayIndexOutOfBoundsException
- Adds a pair of integers at the specified location.
- Parameters:
- x - the int to be added to xArray
- y - the int to be added to yArray
- n - the location in xArray and yArray for adding x and y
- Throws: ArrayIndexOutOfBoundsException
- whenever n is greater than or equal to size() or less than 0
addPair
public void addPair(int x,
int y) throws ArrayIndexOutOfBoundsException
- Adds a pair of integers just beyond the last occupied slot in the arrays.
- Parameters:
- x - the int to be added to xArray
- y - the int to be added to yArray
- Throws: ArrayIndexOutOfBoundsException
- whenever the last element in the arrays is already occupied
All Packages Class Hierarchy This Package Previous Next Index