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

Variable Index

 o xArray
The x array.
 o yArray
The y array.

Constructor Index

 o IntPairs(int)
Constructs and initializes an IntPairs instance with the given size for its arrays.

Method Index

 o addPair(int, int)
Adds a pair of integers just beyond the last occupied slot in the arrays.
 o insertPairAt(int, int, int)
Adds a pair of integers at the specified location.
 o size()
Get the size of the arrays in this object.

Variables

 o xArray
 public int xArray[]
The x array.

 o yArray
 public int yArray[]
The y array.

Constructors

 o 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

Methods

 o size
 public int size()
Get the size of the arrays in this object.

Returns:
the arrays' size
 o 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
 o 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