JanosVM v1.0 API

edu.utah.janosvm.kit.util
Class SparseArrayDimension

java.lang.Object
  |
  +--edu.utah.janosvm.kit.util.SparseArrayDimension

final class SparseArrayDimension
extends java.lang.Object

The objects that make up the SparseArray's X dimension.


Field Summary
private  SparseArrayElement[] elements
          The elements themselves.
private  SparseArrayElement freeElements
          The list of free elements in this dimension.
private  int inUse
          The number of elements in use.
private  SparseArrayElement lastElement
          The last element in the free list.
private  SparseArray sa
          The SparseArray this dimension is a part of.
private  long timeID
          The present delay value.
 
Constructor Summary
(package private) SparseArrayDimension(int xIndex, SparseArray sa)
          Construct a SparseArrayDimension with the given values.
 
Method Summary
(package private)  void dropElement(SparseArrayElement sae)
           
(package private)  void elements(java.util.Vector v)
          Add any allocated elements to the given vector.
(package private)  SparseArrayElement findElement(int yIndex, long id)
          Find an element in this dimension.
(package private)  SparseArrayElement getElement()
           
(package private)  boolean hasFreeElements()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0
 

Field Detail

sa

private SparseArray sa
The SparseArray this dimension is a part of.

freeElements

private SparseArrayElement freeElements
The list of free elements in this dimension.

lastElement

private SparseArrayElement lastElement
The last element in the free list.

inUse

private int inUse
The number of elements in use.

timeID

private long timeID
The present delay value.

elements

private final SparseArrayElement[] elements
The elements themselves.
Constructor Detail

SparseArrayDimension

SparseArrayDimension(int xIndex,
                     SparseArray sa)
               throws java.lang.InstantiationException,
                      java.lang.IllegalAccessException
Construct a SparseArrayDimension with the given values.
Parameters:
xIndex - The X index in the SparseArray.
sa - The SparseArray this dimension belongs too.
Method Detail

hasFreeElements

boolean hasFreeElements()
Returns:
True if there are any free elements in this dimension.

getElement

SparseArrayElement getElement()
Returns:
An allocated element from this dimension.

dropElement

void dropElement(SparseArrayElement sae)
Parameters:
sae - The element to be freed.

findElement

SparseArrayElement findElement(int yIndex,
                               long id)
Find an element in this dimension.
Parameters:
yIndex - The Y index of the element.
id - The whole id of the element.
Returns:
The SparseArrayElement corresponding to the given ID or null.

elements

void elements(java.util.Vector v)
Add any allocated elements to the given vector.
Parameters:
v - A vector to add allocated elements to.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

JanosVM v1.0 API

This documentation is Copyright (C) 2000-2003 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Feb 13, 2003