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<List<Object>>
-
- com.datumbox.framework.common.dataobjects.FlatDataList
-
- All Implemented Interfaces:
Copyable<FlatDataList>,Serializable,Iterable<Object>
public class FlatDataList extends AbstractDataStructureList<List<Object>> implements Iterable<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.- Author:
- Vasilis Vryniotis
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.datumbox.framework.common.dataobjects.AbstractDataStructure
internalData
-
-
Constructor Summary
Constructors Constructor Description FlatDataList()Default constructor which initializes the internal data with an ArrayList.FlatDataList(List<Object> internalData)Constructor that initializes the internal data with the provided list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Object e)Appends the specified element to the end of the internal list.booleanaddAll(Collection<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(Object o)Objectget(int index)Gets an element at the specified position in the internal list.DoublegetDouble(int index)Gets an element at the specified position in this list, converts it into Double and returns its value.inthashCode()Iterator<Object>iterator()Objectremove(int index)Removes an element at the specified position in the internal list and returns it.Objectset(int index, 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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
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 Object remove(int index)
Removes an element at the specified position in the internal list and returns it.- Parameters:
index-- Returns:
-
get
public final Object get(int index)
Gets an element at the specified position in the internal list.- Parameters:
index-- Returns:
-
getDouble
public final 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(Object e)
Appends the specified element to the end of the internal list.- Parameters:
e-- Returns:
-
set
public final Object set(int index, 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(Collection<Object> c)
Adds all the elements of the provided collection in the internal list.- Parameters:
c-- Returns:
-
toFlatDataCollection
public final FlatDataCollection toFlatDataCollection()
Returns a FlatDataCollection with the values of the internal list without coping the data.- Returns:
-
-