Package adams.data.container
Interface DataContainer<T extends DataPoint>
-
- Type Parameters:
T
- the type of data points this container deals with
- All Superinterfaces:
CloneHandler
,Collection<T>
,Comparable
,IDHandler
,Iterable<T>
,Mergeable<DataContainer>
,MutableIDHandler
,Serializable
,UniqueIDHandler
- All Known Subinterfaces:
DataContainerWithSpreadSheetSupport<T>
- All Known Implementing Classes:
AbstractDataContainer
,Instance
,SequencePlotSequence
,SpreadSheetRow
,Timeseries
,XYSequence
public interface DataContainer<T extends DataPoint> extends Serializable, Comparable, CloneHandler, Collection<T>, Mergeable<DataContainer>, MutableIDHandler, UniqueIDHandler
Generic Interface for data containers.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
assign(DataContainer<T> other)
Obtains the stored variables from the other data point, but not the actual data points.int
compareToData(Object o)
Compares this object with the specified object for order.int
compareToHeader(Object o)
Compares this object with the specified object for order.boolean
equalsData(Object obj)
Indicates whether some other container's header is "equal to" this ones.boolean
equalsHeader(Object obj)
Indicates whether some other container's header is "equal to" this ones.Object
getClone()
Returns a clone of itself.DataPointComparator<T>
getComparator()
Returns the comparator in use.DataContainer
getHeader()
Returns an empty container with the same payload data as this one.DataPointComparator<T>
newComparator()
Returns a new instance of the default comparator.T
newPoint()
Returns a new instance of a DataContainer point.List<T>
toList()
Returns a vector with the points.List<T>
toList(DataPointComparator<T> comparator)
Returns a list with the points.TreeSet<T>
toTreeSet()
Returns a treeset with the points.TreeSet<T>
toTreeSet(DataPointComparator<T> comparator)
Returns a treeset with the points, sorted according to the given comparator.-
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface adams.data.id.MutableIDHandler
setID
-
Methods inherited from interface adams.core.UniqueIDHandler
getUniqueID
-
-
-
-
Method Detail
-
newComparator
DataPointComparator<T> newComparator()
Returns a new instance of the default comparator.- Returns:
- the comparator instance
-
getComparator
DataPointComparator<T> getComparator()
Returns the comparator in use.- Returns:
- the comparator in use
-
newPoint
T newPoint()
Returns a new instance of a DataContainer point.- Returns:
- the new DataContainer point
-
getClone
Object getClone()
Returns a clone of itself.- Specified by:
getClone
in interfaceCloneHandler<T extends DataPoint>
- Returns:
- the clone
-
getHeader
DataContainer getHeader()
Returns an empty container with the same payload data as this one.- Returns:
- a clone of the payload
-
assign
void assign(DataContainer<T> other)
Obtains the stored variables from the other data point, but not the actual data points.- Parameters:
other
- the data point to get the values from
-
compareToHeader
int compareToHeader(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException
- if the specified object's type prevents it from being compared to this object.
-
equalsHeader
boolean equalsHeader(Object obj)
Indicates whether some other container's header is "equal to" this ones.- Parameters:
obj
- the reference object with which to compare.- Returns:
- true if this object is the same as the obj argument; false otherwise.
-
compareToData
int compareToData(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException
- if the specified object's type prevents it from being compared to this object.
-
equalsData
boolean equalsData(Object obj)
Indicates whether some other container's header is "equal to" this ones.- Parameters:
obj
- the reference object with which to compare.- Returns:
- true if this object is the same as the obj argument; false otherwise.
-
toList
List<T> toList(DataPointComparator<T> comparator)
Returns a list with the points.- Parameters:
comparator
- the comparator to use- Returns:
- a list with all the points
-
toTreeSet
TreeSet<T> toTreeSet()
Returns a treeset with the points.- Returns:
- a treeset with all the points
-
toTreeSet
TreeSet<T> toTreeSet(DataPointComparator<T> comparator)
Returns a treeset with the points, sorted according to the given comparator.- Parameters:
comparator
- the comparator to use- Returns:
- a treeset with all the points
-
-