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 protected
AbstractObjectMatrix(int... size)
protected
AbstractObjectMatrix(AbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>> o)
Copy constructor.protected
AbstractObjectMatrix(Object[] dataA, int... size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get(int... pos)
Get the value.protected T[]
getDataA()
Returns the data store as an array.String
getPlainString(int pos)
Returns the string representation of the given plain position.protected int
initL(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.void
set(T value, int... pos)
Set the value resizing by need.void
setPlain(String value, int pos)
Sets the entry with plain positionpos
to value parsing the stringvalue
.void
setPlain(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:AbstractGenericMatrix
Returns 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:
newL
in classAbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>
- Returns:
- new D[size]
-
initL
protected final int initL(T[] data, int size)
- Specified by:
initL
in classAbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>
-
getDataA
protected T[] getDataA()
Description copied from class:AbstractGenericMatrix
Returns the data store as an array. There are subclasses with array of primitive types.- Specified by:
getDataA
in 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:AbstractGenericMatrix
Sets the entry with plain positionpos
to value parsing the stringvalue
. Note that this base class cannot provide setter methods for java's primitive data types.- Specified by:
setPlain
in 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:AbstractGenericMatrix
Returns the string representation of the given plain position.- Specified by:
getPlainString
in classAbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>
-
-