Package eu.simuline.octave.type
Class OctaveBoolean
- java.lang.Object
-
- eu.simuline.octave.type.matrix.AbstractGenericMatrix<boolean[],it.unimi.dsi.fastutil.booleans.BooleanArrayList>
-
- eu.simuline.octave.type.OctaveBoolean
-
- All Implemented Interfaces:
OctaveObject
public final class OctaveBoolean extends AbstractGenericMatrix<boolean[],it.unimi.dsi.fastutil.booleans.BooleanArrayList>
Represents a Boolean matrix. Not so appropriate for sparse matrices.- See Also:
OctaveSparseBoolean
-
-
Field Summary
-
Fields inherited from class eu.simuline.octave.type.matrix.AbstractGenericMatrix
dataL, size
-
-
Constructor Summary
Constructors Modifier Constructor Description OctaveBoolean(boolean[] data, int... size)
OctaveBoolean(int... size)
private
OctaveBoolean(OctaveBoolean o)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
get(int... pos)
Get the value.protected boolean[]
getDataA()
Returns the data store as an array.String
getPlainString(int pos)
Returns the string representation of the given plain position.protected int
initL(boolean[] data, int size)
protected it.unimi.dsi.fastutil.booleans.BooleanArrayList
newL(int size)
Returns a new data store with given size and entries carrying the default value.void
set(boolean value, int... pos)
Set the value resizing by need.void
setPlain(boolean value, int pos)
Set the value assuming resize is not necessary.void
setPlain(String value, int pos)
Sets the entry with plain positionpos
to value parsing the stringvalue
.OctaveBoolean
shallowCopy()
Make a shallow copy of this object.-
Methods inherited from class eu.simuline.octave.type.matrix.AbstractGenericMatrix
dataSize, equals, getSize, getSizeLength, hashCode, main, pos2ind, resizeUp, toString
-
-
-
-
Constructor Detail
-
OctaveBoolean
public OctaveBoolean(int... size)
- Parameters:
size
-
-
OctaveBoolean
public OctaveBoolean(boolean[] data, int... size)
- Parameters:
data
-size
-
-
OctaveBoolean
private OctaveBoolean(OctaveBoolean o)
-
-
Method Detail
-
newL
protected final it.unimi.dsi.fastutil.booleans.BooleanArrayList 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<boolean[],it.unimi.dsi.fastutil.booleans.BooleanArrayList>
- Returns:
- new D[size]
-
initL
protected final int initL(boolean[] data, int size)
- Specified by:
initL
in classAbstractGenericMatrix<boolean[],it.unimi.dsi.fastutil.booleans.BooleanArrayList>
-
getDataA
protected boolean[] 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<boolean[],it.unimi.dsi.fastutil.booleans.BooleanArrayList>
-
set
public final void set(boolean value, int... pos)
Set the value resizing by need.- Parameters:
value
-pos
-- See Also:
setPlain(boolean, int)
-
setPlain
public final void setPlain(boolean value, int pos)
Set the value assuming resize is not necessary.- Parameters:
value
-pos
-- See Also:
set(boolean, 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<boolean[],it.unimi.dsi.fastutil.booleans.BooleanArrayList>
pos
- see e.g.AbstractObjectMatrix.setPlain(String, int)
andOctaveDouble.setPlain(String, int)
-
get
public final boolean 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<boolean[],it.unimi.dsi.fastutil.booleans.BooleanArrayList>
-
shallowCopy
public OctaveBoolean 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<boolean[],it.unimi.dsi.fastutil.booleans.BooleanArrayList>
- Returns:
- a shallow copy of this
-
-