marf.util
Class Matrix

java.lang.Object
  extended by java.util.AbstractCollection
      extended by java.util.AbstractList
          extended by java.util.Vector
              extended by marf.util.FreeVector
                  extended by marf.util.Matrix
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class Matrix
extends FreeVector

Free Matrix - a multidimensional extension of FreeVector. The class is properly synchronized.

TODO: complete $Id: Matrix.java,v 1.15 2007/12/23 06:29:47 mokhov Exp $

Since:
0.3.0.1
Version:
$Revision: 1.15 $
Author:
Serguei Mokhov
See Also:
FreeVector, Serialized Form

Field Summary
protected  int[] aiDimensions
          Matrix dimensions.
private static long serialVersionUID
          For serialization versioning.
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Matrix()
          Creates an 1-by-1 matrix.
Matrix(int piCardinality)
          Creates free matrix with certain cardinality.
Matrix(int[] paiDimensions)
          Creates a free matrix with user-defined dimensions.
 
Method Summary
 void add(int[] paiPointIndex, java.lang.Object poElement)
          Not implemented.
 java.lang.Object elementAt(int[] paiPoint)
          Allows to retrieve the object from a multidimensional matrix.
 int getCardinality()
          Retrieves current number of dimensions of the matrix.
 int getDimention(int piDimensionNumber)
          Retrieves a particular dimension value.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 
Methods inherited from class marf.util.FreeVector
add, addAll, elementAt, ensureIndexCapacity, get, insertElementAt, remove, removeRange, set, setElementAt, subList
 
Methods inherited from class java.util.Vector
add, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elements, ensureCapacity, equals, firstElement, hashCode, indexOf, indexOf, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, setSize, size, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

aiDimensions

protected int[] aiDimensions
Matrix dimensions.


serialVersionUID

private static final long serialVersionUID
For serialization versioning. When adding new members or make other structural changes regenerate this number with the serialver tool that comes with JDK.

Since:
0.3.0.4
See Also:
Constant Field Values
Constructor Detail

Matrix

public Matrix(int piCardinality)
Creates free matrix with certain cardinality.

Parameters:
piCardinality - number of dimensions of the matrix.

Matrix

public Matrix(int[] paiDimensions)
Creates a free matrix with user-defined dimensions. The dimensions array is properly clonned internally.

Parameters:
paiDimensions - the desired dimensions; if null, a 1-by-1 matrix created

Matrix

public Matrix()
Creates an 1-by-1 matrix.

Method Detail

getCardinality

public final int getCardinality()
Retrieves current number of dimensions of the matrix.

Returns:
current cardinality

getDimention

public final int getDimention(int piDimensionNumber)
Retrieves a particular dimension value.

Parameters:
piDimensionNumber - dimension number to the the value off
Returns:
the dimension value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the parameter is out of range

elementAt

public java.lang.Object elementAt(int[] paiPoint)
Allows to retrieve the object from a multidimensional matrix.

Parameters:
paiPoint - dimension coordinates
Returns:
object at the specified point coordinates

add

public void add(int[] paiPointIndex,
                java.lang.Object poElement)
Not implemented. Should insert an element at the specified dimensions.

Parameters:
paiPointIndex - dimension coordinates to insert the element at
poElement - the element to insert
Throws:
NotImplementedException

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Retrieves class' revision.

Returns:
revision string
Since:
0.3.0.2


SourceForge Logo