All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.tools.debug.UnboundedArrayOfLong

java.lang.Object
   |
   +----sun.tools.debug.UnboundedArrayOfLong

public class UnboundedArrayOfLong
extends Object
This class implements an array of integers capable of growing forwards or backwards and having any integer value (positive or negative) as an index. It is designed to be space efficient for ranges of indicies at any starting point but compact within the range (ie. 900000 to 900010, or -5400 to -5300). Growth is automatic and will never throw an array bounds error. Not thread safe, synchronization left to user.


Variable Index

 o arr
 o first
 o last

Constructor Index

 o UnboundedArrayOfLong()
Constructor No initial guesses for first and last indicies, determined during use.
 o UnboundedArrayOfLong(long, long)
Constructor Specified initial guesses for first and last indicies.

Method Index

 o at(long)
Return the int at the specified index.
 o getFirstIndex()
Return the lowest allocated index.
 o getLastIndex()
Return the highest allocated index.
 o grow(long, long)
Grow to have the specified new first and last indicies.
 o setAt(long, int)
Set the value at the specified index.

Variables

 o first
 protected long first
 o last
 protected long last
 o arr
 protected Hashtable arr

Constructors

 o UnboundedArrayOfLong
 public UnboundedArrayOfLong(long first,
                             long last)
Constructor Specified initial guesses for first and last indicies.

 o UnboundedArrayOfLong
 public UnboundedArrayOfLong()
Constructor No initial guesses for first and last indicies, determined during use.

Methods

 o at
 public int at(long idx)
Return the int at the specified index. All unset elements have the value zero.

 o setAt
 public void setAt(long idx,
                   int value)
Set the value at the specified index. Grow as needed.

 o getFirstIndex
 public long getFirstIndex()
Return the lowest allocated index.

 o getLastIndex
 public long getLastIndex()
Return the highest allocated index.

 o grow
 protected void grow(long newFirst,
                     long newLast)
Grow to have the specified new first and last indicies.


All Packages  Class Hierarchy  This Package  Previous  Next  Index