com.tagtraum.perf.datastructures
Class HashMatrix
java.lang.Object
|
+--com.tagtraum.perf.datastructures.AbstractMatrix
|
+--com.tagtraum.perf.datastructures.HashMatrix
- All Implemented Interfaces:
- Matrix, java.io.Serializable
- public class HashMatrix
- extends AbstractMatrix
- implements java.io.Serializable
HashMap based matrix. Suitable for sparse matrices. Unsynchronized.
- Version:
- $Id: $
- Author:
- Hendrik Schreiber
- See Also:
- Serialized Form
Method Summary |
java.lang.Object |
get(int col,
int row)
Returns an Object from a given position. |
java.lang.Object |
remove(int col,
int row)
Removes an Object from a given position. |
java.lang.Object |
set(int col,
int row,
java.lang.Object object)
Sets an Object at a given position. |
Methods inherited from class com.tagtraum.perf.datastructures.AbstractMatrix |
addPropertyChangeListener, columns, equals, hashCode, isGrowable, rangeCheck, removePropertyChangeListener, rows, setColumns, setGrowable, setRows, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
HashMatrix
public HashMatrix(int cols,
int rows)
HashMatrix
public HashMatrix(int cols,
int rows,
boolean growable)
set
public java.lang.Object set(int col,
int row,
java.lang.Object object)
- Description copied from interface:
Matrix
- Sets an Object at a given position.
- Specified by:
set
in interface Matrix
- Parameters:
col
- columnrow
- rowobject
- Object to set
- Returns:
- the object that was replaced or
null
if there was none
get
public java.lang.Object get(int col,
int row)
- Description copied from interface:
Matrix
- Returns an Object from a given position.
- Specified by:
get
in interface Matrix
- Parameters:
col
- columnrow
- row
- Returns:
- the object that is at the given position or
null
if there is none
remove
public java.lang.Object remove(int col,
int row)
- Description copied from interface:
Matrix
- Removes an Object from a given position.
- Specified by:
remove
in interface Matrix
- Parameters:
col
- columnrow
- row
- Returns:
- the object that was at the given position or
null
if there was none
Copyright © 2002 Hendrik Schreiber
http://www.tagtraum.com/performance/
This software can be distributed under LGPL