SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu
Interface DeepCopyable

All Known Subinterfaces:
Matrix, MatrixData, SparseMatrix, Vector
All Known Implementing Classes:
Basis, BidiagonalMatrix, BorderedHessian, CovarianceMatrix, CsrSparseMatrix, DenseData, DenseMatrix, DenseVector, DiagonalMatrix, DokSparseMatrix, Ft, Ft, FtWt, FtWt, GivensMatrix, GoldfeldQuandtTrotter, Gradient, Hessian, HilbertMatrix, ImmutableKroneckerProduct, ImmutableMatrix, ImmutableVector, Inverse, Jacobian, JordanExchange, KroneckerProduct, LilSparseMatrix, LowerTriangularMatrix, MatrixList, MatrixMathImpl, MatrixStorageImpl, MatthewsDavies, PermutationMatrix, Pow, PseudoInverse, SparseVector, SubMatrixRef, SymmetricMatrix, TriangularMatrix, TridiagonalMatrix, UpperTriangularMatrix, VectorList

public interface DeepCopyable

This interface provides a way to do polymorphic copying.

Note: an interface (a class) which extends (implements) this interface should override the return type of deepCopy() to the interface (class) itself to provide as much information as possible to avoid unnecessary casting.

For example,

 public interface Matrix extends DeepCopyable {
     ...
     Matrix deepCopy();
 }
 


Method Summary
 java.lang.Object deepCopy()
          The implementation can return an instance created from this by the copy constructor of the class, or just this if the instance itself is immutable.
 

Method Detail

deepCopy

java.lang.Object deepCopy()
The implementation can return an instance created from this by the copy constructor of the class, or just this if the instance itself is immutable.

Returns:
an independent (deep) copy of the instance

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.