com.tagtraum.perf.datastructures
Interface Matrix

All Known Implementing Classes:
AbstractMatrix

public interface Matrix

Matrix that can hold objects, not just primitive values.

Version:
$Id: $
Author:
Hendrik Schreiber

Method Summary
 int columns()
          The number of columns this matrix has.
 java.lang.Object get(int col, int row)
          Returns an Object from a given position.
 boolean isGrowable()
          Indicates whether this matrix can grow or has a fixed size.
 java.lang.Object remove(int col, int row)
          Removes an Object from a given position.
 int rows()
          The number of rows this matrix has.
 java.lang.Object set(int col, int row, java.lang.Object object)
          Sets an Object at a given position.
 

Method Detail

set

public java.lang.Object set(int col,
                            int row,
                            java.lang.Object object)
Sets an Object at a given position.

Parameters:
col - column
row - row
object - Object to set
Returns:
the object that was replaced or null if there was none
Throws:
java.lang.IndexOutOfBoundsException - if col or row are less than zero or greater than the size of this matrix

get

public java.lang.Object get(int col,
                            int row)
Returns an Object from a given position.

Parameters:
col - column
row - row
Returns:
the object that is at the given position or null if there is none
Throws:
java.lang.IndexOutOfBoundsException - if col or row are less than zero or greater than the size of this matrix

remove

public java.lang.Object remove(int col,
                               int row)
Removes an Object from a given position.

Parameters:
col - column
row - row
Returns:
the object that was at the given position or null if there was none
Throws:
java.lang.IndexOutOfBoundsException - if col or row are less than zero or greater than the size of this matrix

columns

public int columns()
The number of columns this matrix has.

Returns:
the number of columns

rows

public int rows()
The number of rows this matrix has.

Returns:
the number of rows

isGrowable

public boolean isGrowable()
Indicates whether this matrix can grow or has a fixed size.



Copyright © 2002 Hendrik Schreiber
http://www.tagtraum.com/performance/
This software can be distributed under LGPL