1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.collections15;
17
18 import java.util.Comparator;
19
20 /***
21 * Defines a type of <code>Bag</code> that maintains a sorted order among its
22 * unique representative members.
23 *
24 * @author Chuck Burdick
25 * @version $Revision: 1.2 $ $Date: 2004/10/17 01:02:42 $
26 * @since Commons Collections 2.0
27 */
28 public interface SortedBag <E> extends Bag<E>
29 {
30
31 /***
32 * Returns the comparator associated with this sorted set, or null if it
33 * uses its elements' natural ordering.
34 *
35 * @return the comparator in use, or null if natural ordering
36 */
37 public Comparator<E> comparator();
38
39 /***
40 * Returns the first (lowest) member.
41 *
42 * @return the first element in the sorted bag
43 */
44 public E first();
45
46 /***
47 * Returns the last (highest) member.
48 *
49 * @return the last element in the sorted bag
50 */
51 public E last();
52
53 }