com.datumbox.framework.common.dataobjects
Class FlatDataList
- java.lang.Object
-
- com.datumbox.framework.common.dataobjects.AbstractDataStructure<T>
-
- com.datumbox.framework.common.dataobjects.AbstractDataStructureCollection<T>
-
- com.datumbox.framework.common.dataobjects.AbstractDataStructureList<java.util.List<java.lang.Object>>
-
- com.datumbox.framework.common.dataobjects.FlatDataList
-
- All Implemented Interfaces:
- Copyable<FlatDataList>, java.io.Serializable, java.lang.Iterable<java.lang.Object>
public class FlatDataList extends AbstractDataStructureList<java.util.List<java.lang.Object>> implements java.lang.Iterable<java.lang.Object>, Copyable<FlatDataList>
The FlatDataList is a data structure that stores internally a List<Object>. The class provides a set of useful methods to access and modify the contents of the collection.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description FlatDataList()Default constructor which initializes the internal data with an ArrayList.FlatDataList(java.util.List<java.lang.Object> internalData)Constructor that initializes the internal data with the provided list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanadd(java.lang.Object e)Appends the specified element to the end of the internal list.booleanaddAll(java.util.Collection<java.lang.Object> c)Adds all the elements of the provided collection in the internal list.FlatDataListcopy()Copies itself and returns a new instance of the same type.booleanequals(java.lang.Object o)java.lang.Objectget(int index)Gets an element at the specified position in the internal list.java.lang.DoublegetDouble(int index)Gets an element at the specified position in this list, converts it into Double and returns its value.inthashCode()java.util.Iterator<java.lang.Object>iterator()java.lang.Objectremove(int index)Removes an element at the specified position in the internal list and returns it.java.lang.Objectset(int index, java.lang.Object element)Replaces the element at the specified position in the internal list with the specified element and returns the previous value.FlatDataCollectiontoFlatDataCollection()Returns a FlatDataCollection with the values of the internal list without coping the data.-
Methods inherited from class com.datumbox.framework.common.dataobjects.AbstractDataStructureCollection
clear, contains, isEmpty, iteratorDouble, size, toArray
-
-
-
-
Constructor Detail
-
FlatDataList
public FlatDataList()
Default constructor which initializes the internal data with an ArrayList.
-
FlatDataList
public FlatDataList(java.util.List<java.lang.Object> internalData)
Constructor that initializes the internal data with the provided list.- Parameters:
internalData-
-
-
Method Detail
-
copy
public FlatDataList copy()
Copies itself and returns a new instance of the same type.- Specified by:
copyin interfaceCopyable<FlatDataList>- Returns:
-
remove
public final java.lang.Object remove(int index)
Removes an element at the specified position in the internal list and returns it.- Parameters:
index-- Returns:
-
get
public final java.lang.Object get(int index)
Gets an element at the specified position in the internal list.- Parameters:
index-- Returns:
-
getDouble
public final java.lang.Double getDouble(int index)
Gets an element at the specified position in this list, converts it into Double and returns its value. The value must be numeric or boolean or else an exception is thrown.- Parameters:
index-- Returns:
-
add
public final boolean add(java.lang.Object e)
Appends the specified element to the end of the internal list.- Parameters:
e-- Returns:
-
set
public final java.lang.Object set(int index, java.lang.Object element)Replaces the element at the specified position in the internal list with the specified element and returns the previous value.- Parameters:
index-element-- Returns:
-
addAll
public final boolean addAll(java.util.Collection<java.lang.Object> c)
Adds all the elements of the provided collection in the internal list.- Parameters:
c-- Returns:
-
iterator
public final java.util.Iterator<java.lang.Object> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Object>
-
toFlatDataCollection
public final FlatDataCollection toFlatDataCollection()
Returns a FlatDataCollection with the values of the internal list without coping the data.- Returns:
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG