package org.eclipse.tracecompass.segmentstore.core;
+import java.util.Collection;
+
/**
* Interface for segment-storing backends.
*
- * @param <T>
+ * @param <E>
* The type of {@link ISegment} element that will be stored in this
* database.
*
* @author Alexandre Montplaisir
*/
-public interface ISegmentStore<T extends ISegment> extends Iterable<T> {
-
- /**
- * Add an element to the database.
- *
- * @param elem The element to add.
- */
- void addElement(T elem);
-
- /**
- * Get the number of element currently existing in the database.
- *
- * @return The number of elements.
- */
- long getNbElements();
+public interface ISegmentStore<E extends ISegment> extends Collection<E> {
/**
* Retrieve all elements that inclusively cross the given position.
* tree's X axis represents time.
* @return The intervals that cross this position
*/
- Iterable<T> getIntersectingElements(long position);
+ Iterable<E> getIntersectingElements(long position);
/**
* Retrieve all elements that inclusively cross another segment. We define
* The target end position
* @return The elements overlapping with this segment
*/
- Iterable<T> getIntersectingElements(long start, long end);
+ Iterable<E> getIntersectingElements(long start, long end);
/**
* Dispose the data structure and release any system resources associated