1 package org.opentrafficsim.core.perception.collections;
2
3 import java.util.Collections;
4 import java.util.Comparator;
5 import java.util.SortedSet;
6
7 import org.opentrafficsim.core.perception.HistoryManager;
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 public abstract class AbstractHistoricalSortedSet<E, S extends SortedSet<E>> extends AbstractHistoricalCollection<E, S>
27 implements HistoricalSortedSet<E>
28 {
29
30
31
32
33
34
35 protected AbstractHistoricalSortedSet(final HistoryManager historyManager, final S set)
36 {
37 super(historyManager, set);
38 }
39
40
41
42
43 @Override
44 public Comparator<? super E> comparator()
45 {
46 return getCollection().comparator();
47 }
48
49
50 @Override
51 public SortedSet<E> subSet(final E fromElement, final E toElement)
52 {
53 return Collections.unmodifiableSortedSet(getCollection().subSet(fromElement, toElement));
54 }
55
56
57 @Override
58 public SortedSet<E> headSet(final E toElement)
59 {
60 return Collections.unmodifiableSortedSet(getCollection().headSet(toElement));
61 }
62
63
64 @Override
65 public SortedSet<E> tailSet(final E fromElement)
66 {
67 return Collections.unmodifiableSortedSet(getCollection().tailSet(fromElement));
68 }
69
70
71 @Override
72 public E first()
73 {
74 return getCollection().first();
75 }
76
77
78 @Override
79 public E last()
80 {
81 return getCollection().last();
82 }
83
84 }