-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIterableMultiKeySortedCollectionInterface.java
More file actions
35 lines (29 loc) · 1.22 KB
/
Copy pathIterableMultiKeySortedCollectionInterface.java
File metadata and controls
35 lines (29 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.util.Iterator;
/**
* This interfaces extends the SortedCollectionInterface to allow storing multiple values for a single key,
* and to iterate over the keys and values stored in the data structure.
*/
public interface IterableMultiKeySortedCollectionInterface<T extends Comparable<T>> extends SortedCollectionInterface<KeyListInterface<T>>, Iterable<T> {
/**
* Inserts value into tree that can store multiple objects per key by keeping
* lists of objects in each node of the tree.
* @param key object to insert
* @return true if obj was inserted
*/
public boolean insertSingleKey(T key);
/**
* @return the number of values in the tree.
*/
public int numKeys();
/**
* Returns an iterator that does an in-order iteration over the tree.
*/
public Iterator<T> iterator();
/**
* Sets the starting point for iterations. Future iterations will start at the
* starting point or the key closest to it in the tree. This setting is remembered
* until it is reset. Passing in null disables the starting point.
* @param startPoint the start point to set for iterations
*/
public void setIterationStartPoint(Comparable<T> startPoint);
}