Class FlatDataCollection
- java.lang.Object
-
- com.datumbox.framework.common.dataobjects.AbstractDataStructure<T>
-
- com.datumbox.framework.common.dataobjects.AbstractDataStructureCollection<Collection<Object>>
-
- com.datumbox.framework.common.dataobjects.FlatDataCollection
-
- All Implemented Interfaces:
Serializable,Iterable<Object>,Collection<Object>
public class FlatDataCollection extends AbstractDataStructureCollection<Collection<Object>> implements Collection<Object>
The FlatDataCollection is a data structure that stores internally a Collection<Object>. The actual implementation of the collection can be Sets, Lists etc and they must store Objects internally. 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 FlatDataCollection(Collection<Object> internalData)Public constructor which accepts as argument a Collection of Objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Object e)It adds an object in the collection.booleanaddAll(Collection<?> c)booleancontainsAll(Collection<?> c)booleanequals(Object o)inthashCode()Iterator<Object>iterator()booleanremove(Object o)Removes a particular object from the internal data.booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)<T> T[]toArray(T[] a)FlatDataListtoFlatDataList()Converts the FlatDataCollection to a FlatDataList trying (if possible) not to copy 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.util.Collection
clear, contains, isEmpty, parallelStream, removeIf, size, spliterator, stream, toArray, toArray
-
-
-
-
Constructor Detail
-
FlatDataCollection
public FlatDataCollection(Collection<Object> internalData)
Public constructor which accepts as argument a Collection of Objects.- Parameters:
internalData-
-
-
Method Detail
-
remove
public final boolean remove(Object o)
Removes a particular object from the internal data. It returns a boolean which indicates whether the object was found the collection.- Specified by:
removein interfaceCollection<Object>- Parameters:
o-- Returns:
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<Object>
-
addAll
public boolean addAll(Collection<?> c)
- Specified by:
addAllin interfaceCollection<Object>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Object>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<Object>
-
add
public final boolean add(Object e)
It adds an object in the collection. It returns a boolean which indicates whether the collection changed as a result of the call.- Specified by:
addin interfaceCollection<Object>- Parameters:
e-- Returns:
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<Object>
-
toFlatDataList
public final FlatDataList toFlatDataList()
Converts the FlatDataCollection to a FlatDataList trying (if possible) not to copy the data.- Returns:
-
equals
public boolean equals(Object o)
- Specified by:
equalsin interfaceCollection<Object>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<Object>- Overrides:
hashCodein classObject
-
-