org.ujmp.core.interfaces
Interface GettersAndSetters

All Known Subinterfaces:
BigDecimalMatrix, BigDecimalMatrix2D, BigIntegerMatrix, BigIntegerMatrix2D, BooleanMatrix, BooleanMatrix2D, ByteMatrix, ByteMatrix2D, CharMatrix, CharMatrix2D, DateMatrix, DateMatrix2D, DenseBigDecimalMatrix, DenseBigDecimalMatrix2D, DenseBigIntegerMatrix, DenseBigIntegerMatrix2D, DenseBooleanMatrix, DenseBooleanMatrix2D, DenseByteMatrix, DenseByteMatrix2D, DenseCharMatrix, DenseCharMatrix2D, DenseDateMatrix, DenseDateMatrix2D, DenseDoubleMatrix, DenseDoubleMatrix2D, DenseFloatMatrix, DenseFloatMatrix2D, DenseGenericMatrix<A>, DenseGenericMatrix2D<A>, DenseIntMatrix, DenseIntMatrix2D, DenseLongMatrix, DenseLongMatrix2D, DenseMatrix, DenseMatrix2D, DenseObjectMatrix, DenseObjectMatrix2D, DenseShortMatrix, DenseShortMatrix2D, DenseStringMatrix, DenseStringMatrix2D, DoubleMatrix, DoubleMatrix2D, FloatMatrix, FloatMatrix2D, GenericMatrix<A>, GenericMatrix2D<A>, GraphMatrix<N,E>, IntMatrix, IntMatrix2D, ListMatrix<A>, LongMatrix, LongMatrix2D, MapMatrix<K,V>, Matrix, Matrix2D, ObjectMatrix, ObjectMatrix2D, SetMatrix<A>, ShortMatrix, ShortMatrix2D, SparseBigDecimalMatrix, SparseBigDecimalMatrix2D, SparseBigIntegerMatrix, SparseBigIntegerMatrix2D, SparseBooleanMatrix, SparseBooleanMatrix2D, SparseByteMatrix, SparseByteMatrix2D, SparseCharMatrix, SparseCharMatrix2D, SparseDateMatrix, SparseDateMatrix2D, SparseDoubleMatrix, SparseDoubleMatrix2D, SparseFloatMatrix, SparseFloatMatrix2D, SparseGenericMatrix<A>, SparseGenericMatrix2D<A>, SparseIntMatrix, SparseIntMatrix2D, SparseLongMatrix, SparseLongMatrix2D, SparseMatrix, SparseMatrix2D, SparseObjectMatrix, SparseObjectMatrix2D, SparseShortMatrix, SparseShortMatrix2D, SparseStringMatrix, SparseStringMatrix2D, StringMatrix, StringMatrix2D, TreeMatrix
All Known Implementing Classes:
AbstractBigDecimalMatrix, AbstractBigIntegerMatrix, AbstractBooleanMatrix, AbstractByteMatrix, AbstractCharMatrix, AbstractDateMatrix, AbstractDenseBigDecimalMatrix, AbstractDenseBigDecimalMatrix2D, AbstractDenseBigIntegerMatrix, AbstractDenseBigIntegerMatrix2D, AbstractDenseBooleanMatrix, AbstractDenseBooleanMatrix2D, AbstractDenseByteMatrix, AbstractDenseByteMatrix2D, AbstractDenseCharMatrix, AbstractDenseCharMatrix2D, AbstractDenseDateMatrix, AbstractDenseDateMatrix2D, AbstractDenseDoubleMatrix, AbstractDenseDoubleMatrix2D, AbstractDenseFloatMatrix, AbstractDenseFloatMatrix2D, AbstractDenseGenericMatrix, AbstractDenseGenericMatrix2D, AbstractDenseIntMatrix, AbstractDenseIntMatrix2D, AbstractDenseLongMatrix, AbstractDenseLongMatrix2D, AbstractDenseObjectMatrix, AbstractDenseObjectMatrix2D, AbstractDenseShortMatrix, AbstractDenseShortMatrix2D, AbstractDenseStringMatrix, AbstractDenseStringMatrix2D, AbstractDoubleMatrix, AbstractFloatMatrix, AbstractGenericMatrix, AbstractGraphMatrix, AbstractIntMatrix, AbstractListMatrix, AbstractLongMatrix, AbstractMapMatrix, AbstractMapToSparseMatrixWrapper, AbstractMapToTiledMatrix2DWrapper, AbstractMatrix, AbstractObjectMatrix, AbstractSetMatrix, AbstractShortMatrix, AbstractSparseBigDecimalMatrix, AbstractSparseBigDecimalMatrix2D, AbstractSparseBigIntegerMatrix, AbstractSparseBigIntegerMatrix2D, AbstractSparseBooleanMatrix, AbstractSparseBooleanMatrix2D, AbstractSparseByteMatrix, AbstractSparseByteMatrix2D, AbstractSparseCharMatrix, AbstractSparseCharMatrix2D, AbstractSparseDateMatrix, AbstractSparseDateMatrix2D, AbstractSparseDoubleMatrix, AbstractSparseDoubleMatrix2D, AbstractSparseFloatMatrix, AbstractSparseFloatMatrix2D, AbstractSparseGenericMatrix, AbstractSparseGenericMatrix2D, AbstractSparseIntMatrix, AbstractSparseIntMatrix2D, AbstractSparseLongMatrix, AbstractSparseLongMatrix2D, AbstractSparseObjectMatrix, AbstractSparseObjectMatrix2D, AbstractSparseShortMatrix, AbstractSparseShortMatrix2D, AbstractSparseStringMatrix, AbstractSparseStringMatrix2D, AbstractStringMatrix, AbstractTreeMatrix, ArrayDenseBigDecimalMatrix2D, ArrayDenseBigIntegerMatrix2D, ArrayDenseByteMatrix2D, ArrayDenseCharMatrix2D, ArrayDenseDoubleMatrix2D, ArrayDenseFloatMatrix2D, BenchmarkConfig, BigDecimalCalculationMatrix, BigIntegerCalculationMatrix, BlockDenseDoubleMatrix2D, BooleanCalculationMatrix, BufferedObjectMatrix, ByteCalculationMatrix, CharCalculationMatrix, CSVMatrix, DateCalculationMatrix, DefaultDenseBigDecimalMatrix2D, DefaultDenseBigIntegerMatrix2D, DefaultDenseBooleanMatrix2D, DefaultDenseByteMatrix2D, DefaultDenseCharMatrix2D, DefaultDenseDateMatrix2D, DefaultDenseDoubleMatrix2D, DefaultDenseDoubleMatrixMultiD, DefaultDenseFloatMatrix2D, DefaultDenseGenericMatrix2D, DefaultDenseIntMatrix2D, DefaultDenseLongMatrix2D, DefaultDenseObjectMatrix2D, DefaultDenseObjectMatrixMultiD, DefaultDenseShortMatrix2D, DefaultDenseStringMatrix2D, DefaultGraphMatrix, DefaultListMatrix, DefaultMapMatrix, DefaultSetMatrix, DefaultSparseBigDecimalMatrix, DefaultSparseBigIntegerMatrix, DefaultSparseBooleanMatrix, DefaultSparseByteMatrix, DefaultSparseCharMatrix, DefaultSparseColumnObjectMatrix2D, DefaultSparseDateMatrix, DefaultSparseDoubleMatrix, DefaultSparseFloatMatrix, DefaultSparseGenericMatrix, DefaultSparseIntMatrix, DefaultSparseLongMatrix, DefaultSparseObjectMatrix, DefaultSparseRowDoubleMatrix2D, DefaultSparseRowObjectMatrix2D, DefaultSparseShortMatrix, DefaultSparseStringMatrix, DefaultTiledObjectMatrix2D, DefaultTreeMatrix, DenseFileMatrix, DoubleCalculationMatrix, EmptyMatrix, FileFormatMatrix, FileListMatrix, FileMatrix, FloatCalculationMatrix, ImageMatrix, IntCalculationMatrix, IrisMatrix, LongCalculationMatrix, MatrixAvailableProcessors, MatrixLibraries, MatrixMemoryUsage, MatrixRandomSeed, MatrixRunningThreads, MatrixSystemEnvironment, MatrixSystemProperties, MatrixSystemTime, MortonDenseDoubleMartrix2D, ObjectCalculationMatrix, ObjectTreeMatrix, RemoteObjectMatrixUDP, SerializedSparseObjectMatrix, ServerObjectMatrixUDP, ShortCalculationMatrix, SimpleDenseDateMatrix2D, SimpleDenseIntMatrix2D, SimpleDenseLongMatrix2D, SimpleDenseObjectMatrix2D, SimpleDenseShortMatrix2D, SimpleDenseStringMatrix2D, SparseCSVMatrix, StringCalculationMatrix, SynchronizedGenericMatrix, TimeSeriesMatrix, UJMPPluginsMatrix, VolatileSparseObjectMatrix, WaveMatrix, WelcomeMatrix

public interface GettersAndSetters

This interface declares the getters and setters for the entries in the Matrix for the most important Java types: boolean, int, char, float, double, long, Date, Object and String.

The matrix will try to convert its content to the desired format as good as possible. For example, a Matrix with String entries will try to parse each String to a Double when you invoke getDoubleValue(). Note, that there will be no exception if the entry cannot be converted. Instead, the result will be either null, 0, false or Double.NaN depending on the method.


Method Summary
 BigDecimal getAsBigDecimal(long... coordinates)
           
 BigInteger getAsBigInteger(long... coordinates)
           
 boolean getAsBoolean(long... coordinates)
          Returns a byte representation of an entry in the matrix.
 byte getAsByte(long... coordinates)
          Returns a byte representation of an entry in the matrix.
 char getAsChar(long... coordinates)
          Returns a char representation of an entry in the matrix.
 Date getAsDate(long... coordinates)
          Returns a Date representation of an entry in the matrix.
 double getAsDouble(long... coordinates)
          Returns a double representation of an entry in the matrix.
 float getAsFloat(long... coordinates)
          Returns a float representation of an entry in the matrix.
 int getAsInt(long... coordinates)
          Returns an int representation of an entry in the matrix.
 long getAsLong(long... coordinates)
          Returns a long representation of an entry in the matrix.
 Matrix getAsMatrix(long... coordinates)
           
 Object getAsObject(long... coordinates)
          Returns a raw entry in the matrix as it is stored.
 short getAsShort(long... coordinates)
          Returns a short representation of an entry in the matrix.
 String getAsString(long... coordinates)
          Returns a String representation of an entry in the matrix.
 Object getPreferredObject(long... coordinates)
          Returns a representation of the entry in the matrix that reflects the true object best.
 void setAsBigDecimal(BigDecimal value, long... coordinates)
           
 void setAsBigInteger(BigInteger value, long... coordinates)
           
 void setAsBoolean(boolean value, long... coordinates)
          Sets an entry in the matrix to a boolean value.
 void setAsByte(byte value, long... coordinates)
          Sets an entry in the matrix to a byte value.
 void setAsChar(char value, long... coordinates)
          Sets an entry in the matrix to a char value.
 void setAsDate(Date date, long... coordinates)
          Sets an entry in the matrix to a Date value.
 void setAsDouble(double value, long... coordinates)
          Sets an entry in the matrix to a double value.
 void setAsFloat(float value, long... coordinates)
          Sets an entry in the matrix to a float value.
 void setAsInt(int value, long... coordinates)
          Sets an entry in the matrix to an int value.
 void setAsLong(long value, long... coordinates)
          Sets an entry in the matrix to a long value.
 void setAsMatrix(Matrix m, long... coordinates)
           
 void setAsObject(Object o, long... coordinates)
          Sets an entry in the matrix to an object.
 void setAsShort(short value, long... coordinates)
          Sets an entry in the matrix to a short value.
 void setAsString(String string, long... coordinates)
          Sets an entry in the matrix to a String value.
 BigDecimal[][] toBigDecimalArray()
           
 BigInteger[][] toBigIntegerArray()
           
 boolean[][] toBooleanArray()
          Converts the content of a matrix into a 2-dimensional array of boolean values.
 byte[][] toByteArray()
          Converts the content of a matrix into a 2-dimensional array of byte values.
 char[][] toCharArray()
          Converts the content of a matrix into a 2-dimensional array of char values.
 Date[][] toDateArray()
          Converts the content of a matrix into a 2-dimensional array of Date values.
 double[][] toDoubleArray()
          Converts the content of a matrix into a 2-dimensional array of double values.
 float[][] toFloatArray()
          Converts the content of a matrix into a 2-dimensional array of float values.
 int[][] toIntArray()
          Converts the content of a matrix into a 2-dimensional array of int values.
 long[][] toLongArray()
          Converts the content of a matrix into a 2-dimensional array of long values.
 Object[][] toObjectArray()
          Converts the content of a matrix into a 2-dimensional array of Objects.
 short[][] toShortArray()
          Converts the content of a matrix into a 2-dimensional array of short values.
 String[][] toStringArray()
          Converts the content of a matrix into a 2-dimensional array of Strings.
 

Method Detail

getAsDouble

double getAsDouble(long... coordinates)
                   throws MatrixException
Returns a double representation of an entry in the matrix. The stored value will be converted to a double as good as possible.

Parameters:
coordinates - location of the entry
Returns:
a double representation of the entry
Throws:
MatrixException

setAsDouble

void setAsDouble(double value,
                 long... coordinates)
                 throws MatrixException
Sets an entry in the matrix to a double value. If the matrix cannot store double values, the value will be represented as good as possible.

Parameters:
value - double value
coordinates - location of the entry
Throws:
MatrixException

getAsObject

Object getAsObject(long... coordinates)
                   throws MatrixException
Returns a raw entry in the matrix as it is stored. If the matrix supports Generics, the return type will match the type that is stored.

Parameters:
coordinates - location of the entry
Returns:
entry object
Throws:
MatrixException

setAsObject

void setAsObject(Object o,
                 long... coordinates)
                 throws MatrixException
Sets an entry in the matrix to an object. If the matrix cannot store this object type, the value will be represented as good as possible.

Parameters:
o - the object to store
coordinates - location of the entry
Throws:
MatrixException

getAsString

String getAsString(long... coordinates)
                   throws MatrixException
Returns a String representation of an entry in the matrix. The stored value will be converted to a String as good as possible.

Parameters:
coordinates - location of the entry
Returns:
a String representation of the entry
Throws:
MatrixException

setAsString

void setAsString(String string,
                 long... coordinates)
                 throws MatrixException
Sets an entry in the matrix to a String value. If the matrix cannot store Strings, the value will be represented as good as possible.

Parameters:
value - String value
coordinates - location of the entry
Throws:
MatrixException

toDoubleArray

double[][] toDoubleArray()
                         throws MatrixException
Converts the content of a matrix into a 2-dimensional array of double values.

Returns:
double array with matrix entries
Throws:
MatrixException

getAsByte

byte getAsByte(long... coordinates)
               throws MatrixException
Returns a byte representation of an entry in the matrix. The stored value will be converted to a byte as good as possible.

Parameters:
coordinates - location of the entry
Returns:
a byte representation of the entry
Throws:
MatrixException

setAsByte

void setAsByte(byte value,
               long... coordinates)
               throws MatrixException
Sets an entry in the matrix to a byte value. If the matrix cannot store byte values, the value will be represented as good as possible.

Parameters:
value - byte value
coordinates - location of the entry
Throws:
MatrixException

toBooleanArray

boolean[][] toBooleanArray()
                           throws MatrixException
Converts the content of a matrix into a 2-dimensional array of boolean values.

Returns:
boolean array with matrix entries
Throws:
MatrixException

toBigDecimalArray

BigDecimal[][] toBigDecimalArray()
                                 throws MatrixException
Throws:
MatrixException

toBigIntegerArray

BigInteger[][] toBigIntegerArray()
                                 throws MatrixException
Throws:
MatrixException

toByteArray

byte[][] toByteArray()
                     throws MatrixException
Converts the content of a matrix into a 2-dimensional array of byte values.

Returns:
byte array with matrix entries
Throws:
MatrixException

getAsBoolean

boolean getAsBoolean(long... coordinates)
                     throws MatrixException
Returns a byte representation of an entry in the matrix. The stored value will be converted to a boolean as good as possible.

Parameters:
coordinates - location of the entry
Returns:
a boolean representation of the entry
Throws:
MatrixException

getAsBigInteger

BigInteger getAsBigInteger(long... coordinates)
                           throws MatrixException
Throws:
MatrixException

getAsBigDecimal

BigDecimal getAsBigDecimal(long... coordinates)
                           throws MatrixException
Throws:
MatrixException

setAsBoolean

void setAsBoolean(boolean value,
                  long... coordinates)
                  throws MatrixException
Sets an entry in the matrix to a boolean value. If the matrix cannot store byte values, the value will be represented as good as possible.

Parameters:
value - boolean value
coordinates - location of the entry
Throws:
MatrixException

setAsBigInteger

void setAsBigInteger(BigInteger value,
                     long... coordinates)
                     throws MatrixException
Throws:
MatrixException

setAsBigDecimal

void setAsBigDecimal(BigDecimal value,
                     long... coordinates)
                     throws MatrixException
Throws:
MatrixException

getAsChar

char getAsChar(long... coordinates)
               throws MatrixException
Returns a char representation of an entry in the matrix. The stored value will be converted to a char as good as possible.

Parameters:
coordinates - location of the entry
Returns:
a char representation of the entry
Throws:
MatrixException

setAsChar

void setAsChar(char value,
               long... coordinates)
               throws MatrixException
Sets an entry in the matrix to a char value. If the matrix cannot store char values, the value will be represented as good as possible.

Parameters:
value - char value
coordinates - location of the entry
Throws:
MatrixException

toCharArray

char[][] toCharArray()
                     throws MatrixException
Converts the content of a matrix into a 2-dimensional array of char values.

Returns:
char array with matrix entries
Throws:
MatrixException

getAsDate

Date getAsDate(long... coordinates)
               throws MatrixException
Returns a Date representation of an entry in the matrix. The stored value will be converted to a Date object as good as possible.

Parameters:
coordinates - location of the entry
Returns:
a String representation of the entry
Throws:
MatrixException

setAsDate

void setAsDate(Date date,
               long... coordinates)
               throws MatrixException
Sets an entry in the matrix to a Date value. If the matrix cannot store Date objects, the value will be represented as good as possible.

Parameters:
value - Date object to store
coordinates - location of the entry
Throws:
MatrixException

toDateArray

Date[][] toDateArray()
                     throws MatrixException
Converts the content of a matrix into a 2-dimensional array of Date values.

Returns:
Date array with matrix entries
Throws:
MatrixException

getAsFloat

float getAsFloat(long... coordinates)
                 throws MatrixException
Returns a float representation of an entry in the matrix. The stored value will be converted to a float as good as possible.

Parameters:
coordinates - location of the entry
Returns:
a float representation of the entry
Throws:
MatrixException

setAsFloat

void setAsFloat(float value,
                long... coordinates)
                throws MatrixException
Sets an entry in the matrix to a float value. If the matrix cannot store float values, the value will be represented as good as possible.

Parameters:
value - float value
coordinates - location of the entry
Throws:
MatrixException

toFloatArray

float[][] toFloatArray()
                       throws MatrixException
Converts the content of a matrix into a 2-dimensional array of float values.

Returns:
float array with matrix entries
Throws:
MatrixException

getAsInt

int getAsInt(long... coordinates)
             throws MatrixException
Returns an int representation of an entry in the matrix. The stored value will be converted to an int as good as possible.

Parameters:
coordinates - location of the entry
Returns:
an int representation of the entry
Throws:
MatrixException

setAsInt

void setAsInt(int value,
              long... coordinates)
              throws MatrixException
Sets an entry in the matrix to an int value. If the matrix cannot store int values, the value will be represented as good as possible.

Parameters:
value - int value
coordinates - location of the entry
Throws:
MatrixException

toIntArray

int[][] toIntArray()
                   throws MatrixException
Converts the content of a matrix into a 2-dimensional array of int values.

Returns:
int array with matrix entries
Throws:
MatrixException

getAsLong

long getAsLong(long... coordinates)
               throws MatrixException
Returns a long representation of an entry in the matrix. The stored value will be converted to a long as good as possible.

Parameters:
coordinates - location of the entry
Returns:
a long representation of the entry
Throws:
MatrixException

setAsLong

void setAsLong(long value,
               long... coordinates)
               throws MatrixException
Sets an entry in the matrix to a long value. If the matrix cannot store long values, the value will be represented as good as possible.

Parameters:
value - long value
coordinates - location of the entry
Throws:
MatrixException

toLongArray

long[][] toLongArray()
                     throws MatrixException
Converts the content of a matrix into a 2-dimensional array of long values.

Returns:
long array with matrix entries
Throws:
MatrixException

toObjectArray

Object[][] toObjectArray()
                         throws MatrixException
Converts the content of a matrix into a 2-dimensional array of Objects.

Returns:
Object array with matrix entries
Throws:
MatrixException

getAsShort

short getAsShort(long... coordinates)
                 throws MatrixException
Returns a short representation of an entry in the matrix. The stored value will be converted to a short as good as possible.

Parameters:
coordinates - location of the entry
Returns:
a short representation of the entry
Throws:
MatrixException

setAsShort

void setAsShort(short value,
                long... coordinates)
                throws MatrixException
Sets an entry in the matrix to a short value. If the matrix cannot store short values, the value will be represented as good as possible.

Parameters:
value - short value
coordinates - location of the entry
Throws:
MatrixException

toShortArray

short[][] toShortArray()
                       throws MatrixException
Converts the content of a matrix into a 2-dimensional array of short values.

Returns:
short array with matrix entries
Throws:
MatrixException

toStringArray

String[][] toStringArray()
                         throws MatrixException
Converts the content of a matrix into a 2-dimensional array of Strings.

Returns:
String array with matrix entries
Throws:
MatrixException

getPreferredObject

Object getPreferredObject(long... coordinates)
                          throws MatrixException
Returns a representation of the entry in the matrix that reflects the true object best. E.g. if the entry is a String "-5.3", this method returns a double with the equivalent value. For a String "text" the string itself is returned.

Parameters:
coordinates - location of the entry
Returns:
object that represents the matrix entry best
Throws:
MatrixException

getAsMatrix

Matrix getAsMatrix(long... coordinates)
                   throws MatrixException
Throws:
MatrixException

setAsMatrix

void setAsMatrix(Matrix m,
                 long... coordinates)
                 throws MatrixException
Throws:
MatrixException


Copyright © 2010. All Rights Reserved.