p3j.misc.math
Class Matrix

java.lang.Object
  extended by p3j.misc.math.Matrix
All Implemented Interfaces:
Serializable

public class Matrix
extends Object
implements Serializable

Matrix object that contains its value as a Matrix2D. It also provides an ID and hash code calculation routines, so that similar matrices can be found easily by the storage system. Created: August 18, 2008

Author:
Christina Bohk, Roland Ewald
See Also:
Serialized Form

Constructor Summary
Matrix()
          Instantiates a new matrix (only required for beans compliance, do not use manually).
Matrix(Matrix2D val)
          Default constructor.
 
Method Summary
 Matrix copy()
          Creates (deep) copy of this matrix, apart from the ID.
 boolean equals(Object o)
           
 long getHash()
           
 int getID()
           
 Matrix2D getValue()
           
 int hashCode()
           
 void setHash(long hash)
           
 void setID(int id)
           
 void setValue(Matrix2D value)
          Sets the value of the matrix.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Matrix

public Matrix(Matrix2D val)
Default constructor.

Parameters:
val - the associated value

Matrix

public Matrix()
Instantiates a new matrix (only required for beans compliance, do not use manually).

Method Detail

copy

public Matrix copy()
Creates (deep) copy of this matrix, apart from the ID. The ID of the copy is set to -1.

Returns:
copy of this matrix

getID

public int getID()

setID

public void setID(int id)

getHash

public long getHash()

setHash

public void setHash(long hash)

getValue

public Matrix2D getValue()

setValue

public void setValue(Matrix2D value)
Sets the value of the matrix. Also updates the hash code of the object.

Parameters:
value - the new value

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2012. All Rights Reserved.