00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __INTERVAL_SET_H__
00030 #define __INTERVAL_SET_H__
00031
00032
00033 #include "Interval.h"
00034
00035
00036 #include <LEDA/list.h>
00037
00038
00039 class IntervalSet
00040 {
00041 public:
00042
00043
00044
00045
00046
00047
00048 IntervalSet();
00049 IntervalSet(const list<Interval> & aListOfInterval);
00050 IntervalSet(const IntervalSet & aIntervalSet);
00051 ~IntervalSet();
00052
00053
00054
00055
00056
00057
00058 IntervalSet & operator=(const IntervalSet & aIntervalSet);
00059
00060
00061
00062
00063
00064
00065 void Print() const;
00066
00067
00068
00069
00070
00071
00072 int GetLength() const { return mLength; }
00073 Interval GetInterval(int aIndex) const
00074 { return mListOfInterval.inf(mListOfInterval[aIndex]); }
00075
00076
00077
00078
00079
00080
00081
00082
00083 void Insert(Interval & aInterval);
00084 void Remove(Interval & aInterval);
00085
00086
00087
00088
00089
00090 friend IntervalSet
00091 merge(const IntervalSet & Lhs, const IntervalSet & Rhs);
00092
00093 friend ostream&
00094 operator<<(ostream& os, const IntervalSet& aIntervalSet);
00095 friend istream&
00096 operator>>(istream& is, IntervalSet& aIntervalSet);
00097
00098
00099 private:
00100
00101 list<Interval> mListOfInterval;
00102 int mLength;
00103 };
00104
00105
00106 #endif
00107