01: /*
02: * Created on Oct 6, 2004
03: */
04: package net.sourceforge.orbroker;
05:
06: import java.util.Comparator;
07: import java.util.SortedSet;
08: import java.util.TreeSet;
09:
10: /**
11: * @author Nils Kilden-Pedersen
12: */
13: final class LazySortedSet extends LazyCollection implements SortedSet {
14:
15: LazySortedSet(Broker broker, String statementID,
16: ConnectionContext context) {
17: super (broker, statementID, context, new TreeSet());
18: }
19:
20: private SortedSet getSortedSet() {
21: return (SortedSet) getCollection();
22: }
23:
24: /**
25: * @inheritDoc
26: * @see java.util.SortedSet#first()
27: */
28: public Object first() {
29: return getSortedSet().first();
30: }
31:
32: /**
33: * @inheritDoc
34: * @see java.util.SortedSet#last()
35: */
36: public Object last() {
37: return getSortedSet().last();
38: }
39:
40: /**
41: * @inheritDoc
42: * @see java.util.SortedSet#comparator()
43: */
44: public Comparator comparator() {
45: return getSortedSet().comparator();
46: }
47:
48: /**
49: * @inheritDoc
50: * @see java.util.SortedSet#headSet(java.lang.Object)
51: */
52: public SortedSet headSet(Object toElement) {
53: return getSortedSet().headSet(toElement);
54: }
55:
56: /**
57: * @inheritDoc
58: * @see java.util.SortedSet#tailSet(java.lang.Object)
59: */
60: public SortedSet tailSet(Object fromElement) {
61: return getSortedSet().tailSet(fromElement);
62: }
63:
64: /**
65: * @inheritDoc
66: * @see java.util.SortedSet#subSet(java.lang.Object, java.lang.Object)
67: */
68: public SortedSet subSet(Object fromElement, Object toElement) {
69: return getSortedSet().subSet(fromElement, toElement);
70: }
71: }
|