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 OctaveObject
DEFAULT_VALUE
For some reason, the default value is not stored as such, but as anull
value.-
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)
private
OctaveCell(AbstractGenericMatrix<OctaveObject[],it.unimi.dsi.fastutil.objects.ObjectArrayList<OctaveObject>> o)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OctaveObject
get(int... pos)
Get the value.<T extends OctaveObject>
Tget(Class<T> castClass, int... pos)
void
set(OctaveObject value, int... pos)
Set the value resizing by need.OctaveCell
shallowCopy()
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 anull
value. 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, thatnull
is 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:AbstractObjectMatrix
Set the value resizing by need.- Overrides:
set
in classAbstractObjectMatrix<OctaveObject>
- See Also:
AbstractObjectMatrix.setPlain(Object, int)
-
get
public OctaveObject get(int... pos)
Description copied from class:AbstractObjectMatrix
Get the value.- Overrides:
get
in 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:OctaveObject
Make a shallow copy of this object. In general when anOctaveObject
is returned from a getter, e.g. onOctaveStruct
orOctaveStruct
, a shallow copy is returned in order to follow the way octave behaves. This method is used to make that copy.- Specified by:
shallowCopy
in interfaceOctaveObject
- Specified by:
shallowCopy
in classAbstractGenericMatrix<OctaveObject[],it.unimi.dsi.fastutil.objects.ObjectArrayList<OctaveObject>>
- Returns:
- a shallow copy of this
-
-