com.datumbox.framework.common.dataobjects
Class FlatDataCollection
- java.lang.Object
-
- com.datumbox.framework.common.dataobjects.AbstractDataStructure<T>
-
- com.datumbox.framework.common.dataobjects.AbstractDataStructureCollection<java.util.Collection<java.lang.Object>>
-
- com.datumbox.framework.common.dataobjects.FlatDataCollection
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>
public class FlatDataCollection extends AbstractDataStructureCollection<java.util.Collection<java.lang.Object>> implements java.util.Collection<java.lang.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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description FlatDataCollection(java.util.Collection<java.lang.Object> internalData)Public constructor which accepts as argument a Collection of Objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanadd(java.lang.Object e)It adds an object in the collection.booleanaddAll(java.util.Collection<?> c)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object o)inthashCode()java.util.Iterator<java.lang.Object>iterator()booleanremove(java.lang.Object o)Removes a particular object from the internal data.booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.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
getClass, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
FlatDataCollection
public FlatDataCollection(java.util.Collection<java.lang.Object> internalData)
Public constructor which accepts as argument a Collection of Objects.- Parameters:
internalData-
-
-
Method Detail
-
remove
public final boolean remove(java.lang.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 interfacejava.util.Collection<java.lang.Object>- Parameters:
o-- Returns:
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAllin interfacejava.util.Collection<java.lang.Object>
-
addAll
public boolean addAll(java.util.Collection<?> c)
- Specified by:
addAllin interfacejava.util.Collection<java.lang.Object>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAllin interfacejava.util.Collection<java.lang.Object>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAllin interfacejava.util.Collection<java.lang.Object>
-
add
public final boolean add(java.lang.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 interfacejava.util.Collection<java.lang.Object>- Parameters:
e-- Returns:
-
iterator
public final java.util.Iterator<java.lang.Object> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Object>- Specified by:
iteratorin interfacejava.util.Collection<java.lang.Object>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<java.lang.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(java.lang.Object o)
- Specified by:
equalsin interfacejava.util.Collection<java.lang.Object>- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Collection<java.lang.Object>- Overrides:
hashCodein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG