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.
-
arr
-
-
first
-
-
last
-
-
UnboundedArrayOfLong()
- Constructor
No initial guesses for first and last indicies, determined during use.
-
UnboundedArrayOfLong(long, long)
- Constructor
Specified initial guesses for first and last indicies.
-
at(long)
- Return the int at the specified index.
-
getFirstIndex()
- Return the lowest allocated index.
-
getLastIndex()
- Return the highest allocated index.
-
grow(long, long)
- Grow to have the specified new first and last indicies.
-
setAt(long, int)
- Set the value at the specified index.
first
protected long first
last
protected long last
arr
protected Hashtable arr
UnboundedArrayOfLong
public UnboundedArrayOfLong(long first,
long last)
- Constructor
Specified initial guesses for first and last indicies.
UnboundedArrayOfLong
public UnboundedArrayOfLong()
- Constructor
No initial guesses for first and last indicies, determined during use.
at
public int at(long idx)
- Return the int at the specified index. All unset elements have the
value zero.
setAt
public void setAt(long idx,
int value)
- Set the value at the specified index. Grow as needed.
getFirstIndex
public long getFirstIndex()
- Return the lowest allocated index.
getLastIndex
public long getLastIndex()
- Return the highest allocated index.
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