marf.util
Class Matrix

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

public class Matrix
extends FreeVector

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

TODO: complete $Id: Matrix.java,v 1.14 2005/08/11 00:44:50 mokhov Exp $

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

Field Summary
protected  int[] aiDimensions
          Matrix dimensions.
 
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.

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