com.datumbox.framework.common.dataobjects
Class AbstractDataStructure<T>
- java.lang.Object
-
- com.datumbox.framework.common.dataobjects.AbstractDataStructure<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- AbstractDataStructureCollection, AbstractDataStructureMap
public abstract class AbstractDataStructure<T> extends java.lang.Object implements java.io.SerializableCommon DataStructures used internally by the Framework. The framework requires a variety of different DataStructures such as Lists, Arrays, Sets, Maps, Maps of Maps etc. Their use depends on the method or algorithm. While designing the framework we had the option to use either native collections (such as Lists<Double>) or build wrapper classes for each supported data structure. We follow the latter approach. The benefit of this is that we limit the number of total Data Structures used internally in the framework, making the methods and utility classes easier to reuse. Moreover the wrapped classes make possible the conversion between different Data Structures without copying the data and they provide a number of extra convenience methods. You should note that all DataStructures store values as Objects. This is done deliberately because the types of the data that we store is not always known at compile time but rather on runtime. Moreover keeping everything stored as Objects helps us to avoid copying the data while converting one collection type to the other. The framework takes care of any conversion on the fly, so you don't need to worry about it. Note that this Abstract class is the parent class for all the common internalDatastructures of the framework. Below we provide a mapping between the AbstractDataStructure classes of the framework and the wrapped Java Collection: AbstractDataStructure Class Wrapped Java Collection ------------------- ----------------------- FlatDataList List<Object> FlatDataCollection Collection<Object> AssociativeArray Map<Object, Object> TransposeDataList Map<Object, FlatDataList> TransposeDataCollection Map<Object, FlatDataCollection> TransposeDataCollection2D Map<Object, TransposeDataCollection> AssociativeArray2D Map<Object, AssociativeArray> DataTable2D Map<Object, AssociativeArray>- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description AbstractDataStructure(T data)Public constructor which takes as argument the appropriate Java collection for each DataStructure.
-
-
-
Constructor Detail
-
AbstractDataStructure
public AbstractDataStructure(T data)
Public constructor which takes as argument the appropriate Java collection for each DataStructure.- Parameters:
data-
-
-
DataMelt 3.0 © DataMelt by jWork.ORG