org.idoox.wasp
Class HashSparseArray

java.lang.Object
  extended byorg.idoox.wasp.HashSparseArray
All Implemented Interfaces:
SparseArray

Deprecated. Sparse arrays are no longer supported.

public class HashSparseArray
extends java.lang.Object
implements SparseArray

HashMap based implementation of SparseArray.

Since:
4.0
Component:
Core-Backward-Compatible

Constructor Summary
HashSparseArray(int dimensions)
          Deprecated. Creates a new HashSparseArray instance.
 
Method Summary
 int[] getDimensions()
          Deprecated. Returns an array of dimensions.
 java.lang.Object getItem(int position)
          Deprecated. Returns item at the given position.
 java.lang.Object getItem(int[] position)
          Deprecated. Returns item at the given position.
 java.util.Iterator getPositions()
          Deprecated. Returns a set of positions.
 void setItem(int[] position, java.lang.Object value)
          Deprecated. Sets item at the given position.
 void setItem(int position, java.lang.Object value)
          Deprecated. Sets item at the given position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashSparseArray

public HashSparseArray(int dimensions)
Deprecated. 
Creates a new HashSparseArray instance.

Parameters:
dimensions - the number of dimensions of the array
Method Detail

getItem

public java.lang.Object getItem(int[] position)
Deprecated. 
Returns item at the given position. If there is no item at that position, null is returned

Specified by:
getItem in interface SparseArray
Parameters:
position - the position
Returns:
item at that position or null if the position is unoccupied

getItem

public java.lang.Object getItem(int position)
Deprecated. 
Returns item at the given position. If there is no item at that position, null is returned. This is just a helper function for one dimensional case.

Specified by:
getItem in interface SparseArray
Parameters:
position - the position
Returns:
item at that position or null if the position is unoccupied.

setItem

public void setItem(int[] position,
                    java.lang.Object value)
Deprecated. 
Sets item at the given position.

Specified by:
setItem in interface SparseArray
Parameters:
position - the position
value - the value to be set

setItem

public void setItem(int position,
                    java.lang.Object value)
Deprecated. 
Sets item at the given position. This is just a helper function for one dimensional case.

Specified by:
setItem in interface SparseArray
Parameters:
position - the position
value - the value to be set

getPositions

public java.util.Iterator getPositions()
Deprecated. 
Returns a set of positions. A position is represented as an array of ints.

Specified by:
getPositions in interface SparseArray
Returns:
iterator of positions

getDimensions

public int[] getDimensions()
Deprecated. 
Returns an array of dimensions.

Specified by:
getDimensions in interface SparseArray
Returns:
the minimal dimensions of the array