Package eu.simuline.octave.type.matrix
Class AbstractObjectMatrix<T>
- java.lang.Object
-
- eu.simuline.octave.type.matrix.AbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>
-
- eu.simuline.octave.type.matrix.AbstractObjectMatrix<T>
-
- Type Parameters:
T- Type of the values
- All Implemented Interfaces:
OctaveObject
- Direct Known Subclasses:
OctaveCell
public abstract class AbstractObjectMatrix<T> extends AbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>
General matrix with Object values which serves also as base class forOctaveCell.
-
-
Field Summary
-
Fields inherited from class eu.simuline.octave.type.matrix.AbstractGenericMatrix
dataL, size
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractObjectMatrix(int... size)protectedAbstractObjectMatrix(AbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>> o)Copy constructor.protectedAbstractObjectMatrix(Object[] dataA, int... size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget(int... pos)Get the value.protected T[]getDataA()Returns the data store as an array.StringgetPlainString(int pos)Returns the string representation of the given plain position.protected intinitL(T[] data, int size)protected it.unimi.dsi.fastutil.objects.ObjectArrayList<T>newL(int size)Returns a new data store with given size and entries carrying the default value.voidset(T value, int... pos)Set the value resizing by need.voidsetPlain(String value, int pos)Sets the entry with plain positionposto value parsing the stringvalue.voidsetPlain(T value, int pos)Set the value assuming resize is not necessary.-
Methods inherited from class eu.simuline.octave.type.matrix.AbstractGenericMatrix
dataSize, equals, getSize, getSizeLength, hashCode, main, pos2ind, resizeUp, shallowCopy, toString
-
-
-
-
Constructor Detail
-
AbstractObjectMatrix
protected AbstractObjectMatrix(int... size)
- Parameters:
size-
-
AbstractObjectMatrix
protected AbstractObjectMatrix(Object[] dataA, int... size)
- Parameters:
dataA-size-
-
AbstractObjectMatrix
protected AbstractObjectMatrix(AbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>> o)
Copy constructor.- Parameters:
o-
-
-
Method Detail
-
newL
protected final it.unimi.dsi.fastutil.objects.ObjectArrayList<T> newL(int size)
Description copied from class:AbstractGenericMatrixReturns a new data store with given size and entries carrying the default value. The latter depends on the types: false for boolean, 0 for int, 0.0 for double and null for GenericMatrix's.- Specified by:
newLin classAbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>- Returns:
- new D[size]
-
initL
protected final int initL(T[] data, int size)
- Specified by:
initLin classAbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>
-
getDataA
protected T[] getDataA()
Description copied from class:AbstractGenericMatrixReturns the data store as an array. There are subclasses with array of primitive types.- Specified by:
getDataAin classAbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>
-
set
public void set(T value, int... pos)
Set the value resizing by need.- Parameters:
value-pos-- See Also:
setPlain(Object, int)
-
setPlain
public final void setPlain(T value, int pos)
Set the value assuming resize is not necessary.- Parameters:
value-pos-- See Also:
set(Object, int[])
-
setPlain
public final void setPlain(String value, int pos)
Description copied from class:AbstractGenericMatrixSets the entry with plain positionposto value parsing the stringvalue. Note that this base class cannot provide setter methods for java's primitive data types.- Specified by:
setPlainin classAbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>pos- see e.g.setPlain(String, int)andOctaveDouble.setPlain(String, int)
-
get
public T get(int... pos)
Get the value.- Parameters:
pos-- Returns:
- value at pos
-
getPlainString
public final String getPlainString(int pos)
Description copied from class:AbstractGenericMatrixReturns the string representation of the given plain position.- Specified by:
getPlainStringin classAbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>
-
-