ss: Make ISegmentStore implement Collection
[deliverable/tracecompass.git] / statesystem / org.eclipse.tracecompass.segmentstore.core / src / org / eclipse / tracecompass / segmentstore / core / ISegmentStore.java
index 41af51d1442467ab303c59af30d518a7f48bc3e0..774dac2833a1005776ccaf0538c622483062c6df 100644 (file)
 
 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.
@@ -45,7 +33,7 @@ public interface ISegmentStore<T extends ISegment> extends Iterable<T> {
      *            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
@@ -64,7 +52,7 @@ public interface ISegmentStore<T extends ISegment> extends Iterable<T> {
      *            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
This page took 0.025283 seconds and 5 git commands to generate.