00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef COH_TREE_SET_HPP
00017 #define COH_TREE_SET_HPP
00018
00019 #include "coherence/lang.ns"
00020
00021 #include "coherence/util/Comparator.hpp"
00022 #include "coherence/util/MappedSet.hpp"
00023 #include "coherence/util/SortedSet.hpp"
00024 #include "coherence/util/TreeMap.hpp"
00025
00026 COH_OPEN_NAMESPACE2(coherence,util)
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class COH_EXPORT TreeSet
00041 : public cloneable_spec<TreeSet,
00042 extends<MappedSet>,
00043 implements<SortedSet> >
00044 {
00045 friend class factory<TreeSet>;
00046
00047
00048
00049 protected:
00050
00051
00052
00053
00054 TreeSet();
00055
00056
00057
00058
00059
00060
00061
00062 TreeSet(Comparator::View vComparator);
00063
00064
00065
00066
00067
00068
00069 TreeSet(SortedMap::Handle hMap);
00070
00071
00072
00073
00074
00075
00076 TreeSet(SortedMap::View vMap);
00077
00078
00079
00080
00081 TreeSet(const TreeSet& that);
00082
00083
00084
00085 public:
00086
00087
00088
00089 virtual Comparator::View comparator() const;
00090
00091
00092
00093
00094 virtual SortedSet::Handle subSet(Object::View vFromElement,
00095 Object::View vToElement);
00096
00097
00098
00099
00100 virtual SortedSet::View subSet(Object::View vFromElement,
00101 Object::View vToElement) const;
00102
00103
00104
00105
00106 virtual SortedSet::Handle headSet(Object::View vToElement);
00107
00108
00109
00110
00111 virtual SortedSet::View headSet(Object::View vToElement) const;
00112
00113
00114
00115
00116 virtual SortedSet::Handle tailSet(Object::View vFromElement);
00117
00118
00119
00120
00121 virtual SortedSet::View tailSet(Object::View vFromElement) const;
00122
00123
00124
00125
00126 virtual Object::View first() const;
00127
00128
00129
00130
00131 virtual Object::View last() const;
00132
00133
00134
00135 protected:
00136
00137
00138
00139
00140
00141 virtual void ensureMap();
00142
00143
00144
00145
00146
00147
00148 virtual SortedMap::Handle getSortedMap();
00149
00150
00151
00152
00153
00154
00155 virtual SortedMap::View getSortedMap() const;
00156 };
00157
00158 COH_CLOSE_NAMESPACE2
00159
00160 #endif // COH_TREE_SET_HPP