Package org.djunits.value.storage
Class Storage<T extends Storage<T>>
java.lang.Object
org.djunits.value.storage.Storage<T>
- Type Parameters:
T- the vector or matrix data type
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
DoubleMatrixData,DoubleVectorData,FloatMatrixData,FloatVectorData
public abstract class Storage<T extends Storage<T>>
extends Object
implements Cloneable, Serializable
StorageInterface.java.
Copyright (c) 2019-2025 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
- Author:
- Alexander Verbraeck
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intCompute and return the number of non-zero cells in this indexed value.abstract Tcopy()Create and return a deep copy of the data.final StorageTypeReturn the StorageType (DENSE, SPARSE, etc.) for the stored indexed value.final booleanisDense()Is this indexed value dense?final booleanisSparse()Is this indexed value sparse?
-
Constructor Details
-
Storage
Construct a new Data store.- Parameters:
storageType- the data type
-
-
Method Details
-
getStorageType
Return the StorageType (DENSE, SPARSE, etc.) for the stored indexed value.- Returns:
- the StorageType (DENSE, SPARSE, etc.) for the stored indexed value
-
isDense
public final boolean isDense()Is this indexed value dense?- Returns:
- true if the data storage type is dense; false if the data storage type is not dense
-
isSparse
public final boolean isSparse()Is this indexed value sparse?- Returns:
- true if the data storage type is sparse; false if the data storage type is not sparse
-
cardinality
public abstract int cardinality()Compute and return the number of non-zero cells in this indexed value.- Returns:
- the number of non-zero cells
-
copy
Create and return a deep copy of the data.- Returns:
- a deep copy of the data
-