Package eu.simuline.octave.type
Class OctaveCell
- java.lang.Object
-
- eu.simuline.octave.type.matrix.AbstractGenericMatrix<T[],it.unimi.dsi.fastutil.objects.ObjectArrayList<T>>
-
- eu.simuline.octave.type.matrix.AbstractObjectMatrix<OctaveObject>
-
- eu.simuline.octave.type.OctaveCell
-
- All Implemented Interfaces:
OctaveObject
public final class OctaveCell extends AbstractObjectMatrix<OctaveObject> implements OctaveObject
Nd cells.
-
-
Field Summary
Fields Modifier and Type Field Description private static OctaveObjectDEFAULT_VALUEFor some reason, the default value is not stored as such, but as anullvalue.-
Fields inherited from class eu.simuline.octave.type.matrix.AbstractGenericMatrix
dataL, size
-
-
Constructor Summary
Constructors Modifier Constructor Description OctaveCell()Deprecated.use: new OctaveCell(0, 0)OctaveCell(int... size)privateOctaveCell(AbstractGenericMatrix<OctaveObject[],it.unimi.dsi.fastutil.objects.ObjectArrayList<OctaveObject>> o)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OctaveObjectget(int... pos)Get the value.<T extends OctaveObject>
Tget(Class<T> castClass, int... pos)voidset(OctaveObject value, int... pos)Set the value resizing by need.OctaveCellshallowCopy()Make a shallow copy of this object.-
Methods inherited from class eu.simuline.octave.type.matrix.AbstractObjectMatrix
getDataA, getPlainString, initL, newL, setPlain, setPlain
-
Methods inherited from class eu.simuline.octave.type.matrix.AbstractGenericMatrix
dataSize, equals, getSize, getSizeLength, hashCode, main, pos2ind, resizeUp, toString
-
-
-
-
Field Detail
-
DEFAULT_VALUE
private static final OctaveObject DEFAULT_VALUE
For some reason, the default value is not stored as such, but as anullvalue. Thus both in methodsset(OctaveObject, int[])and inget(int[]), the value must be reconstructed. **** The reason for that, i cannot figure out. Instead I would pressume, thatnullis translated into[], as elsewhere in octave's java-interface.
-
-
Constructor Detail
-
OctaveCell
@Deprecated public OctaveCell()
Deprecated.use: new OctaveCell(0, 0)Warn about usage of old constructor.
-
OctaveCell
public OctaveCell(int... size)
- Parameters:
size-
-
OctaveCell
private OctaveCell(AbstractGenericMatrix<OctaveObject[],it.unimi.dsi.fastutil.objects.ObjectArrayList<OctaveObject>> o)
-
-
Method Detail
-
set
public void set(OctaveObject value, int... pos)
Description copied from class:AbstractObjectMatrixSet the value resizing by need.- Overrides:
setin classAbstractObjectMatrix<OctaveObject>- See Also:
AbstractObjectMatrix.setPlain(Object, int)
-
get
public OctaveObject get(int... pos)
Description copied from class:AbstractObjectMatrixGet the value.- Overrides:
getin classAbstractObjectMatrix<OctaveObject>- Returns:
- value at pos
-
get
public <T extends OctaveObject> T get(Class<T> castClass, int... pos)
- Type Parameters:
T-- Parameters:
pos-castClass- Class to cast to- Returns:
- shallow copy of value for this key.
- Throws:
OctaveClassCastException- if the object can not be cast to a castClass
-
shallowCopy
public OctaveCell shallowCopy()
Description copied from interface:OctaveObjectMake a shallow copy of this object. In general when anOctaveObjectis returned from a getter, e.g. onOctaveStructorOctaveStruct, a shallow copy is returned in order to follow the way octave behaves. This method is used to make that copy.- Specified by:
shallowCopyin interfaceOctaveObject- Specified by:
shallowCopyin classAbstractGenericMatrix<OctaveObject[],it.unimi.dsi.fastutil.objects.ObjectArrayList<OctaveObject>>- Returns:
- a shallow copy of this
-
-