1 |
<HTML> |
2 |
<HEAD> |
3 |
<TITLE>class Range</TITLE> |
4 |
<META NAME="GENERATOR" CONTENT="DOC++ 3.4"> |
5 |
</HEAD> |
6 |
<BODY BGCOLOR="#ffffff"> |
7 |
|
8 |
<H2>class <A HREF="#DOC.DOCU">Range</A></H2> |
9 |
<BLOCKQUOTE>Range is a simple class for storing one range. A range is specified by giving the minimum and maximum value for the range. Values within the range include the minimum and maximum range values, ie the ranges are inclusive. </BLOCKQUOTE> |
10 |
<HR> |
11 |
|
12 |
<DL> |
13 |
<P><DL> |
14 |
<DT><H3>Public Methods</H3><DD><DT> |
15 |
<A HREF="#DOC.2.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> <B>Range</B>() |
16 |
<DD><I>Default constructor. No attempt is made to initialise the minimum or maximum value for the range. Min and max will have the value designated by their default constructor. </I> |
17 |
<DT> |
18 |
<A HREF="#DOC.2.2"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> <B>Range</B>(const T& min, const T& max) |
19 |
<DD><I>Constructor. Construct a valid range with the given minimum and maximum value. </I> |
20 |
<DT> |
21 |
<A HREF="#DOC.2.3"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> <B>Range</B>(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in) |
22 |
<DD><I>Copy constructor. </I> |
23 |
<DT> |
24 |
<A HREF="#DOC.2.4"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void <B>setRange</B>(const T& min, const T& max) |
25 |
<DD><I>Set the minimum and maximum value for the range </I> |
26 |
<DT> |
27 |
<A HREF="#DOC.2.5"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>T <B>getMin</B>() const |
28 |
<DD><I>Return the minimum value for the range </I> |
29 |
<DT> |
30 |
<A HREF="#DOC.2.6"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>T <B>getMax</B>() const |
31 |
<DD><I>Return the maximum value for the range </I> |
32 |
<DT> |
33 |
<A HREF="#DOC.2.7"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>string <B>toString</B>() const |
34 |
<DD><I>Return a textual representation of the range. </I> |
35 |
<DT> |
36 |
<A HREF="#DOC.2.8"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>T <B>getDifference</B>() const |
37 |
<DD><I>Return the difference between rmax and rmin </I> |
38 |
<DT> |
39 |
<A HREF="#DOC.2.9"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>bool <B>overlap</B>(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in) const |
40 |
<DD><I>function used to determine whether the input range overlaps this range. </I> |
41 |
<DT> |
42 |
<A HREF="#DOC.2.10"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>bool <B>within</B>(const T& value) const |
43 |
<DD><I>function used to determine whether the given value is within the specified range. </I> |
44 |
<DT> |
45 |
<A HREF="#DOC.2.11"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="Range.html#DOC.2.1">Range</A><T> & <B>operator=</B>(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in) |
46 |
<DD><I>operator=</I> |
47 |
<DT> |
48 |
<A HREF="#DOC.2.12"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>bool <B>operator==</B>(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in) const |
49 |
<DD><I>operator==</I> |
50 |
<DT> |
51 |
<A HREF="#DOC.2.13"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>bool <B>operator<</B>(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in) const |
52 |
<DD><I>operator<, only the lower bounds are used for comparison.</I> |
53 |
<DT> |
54 |
<A HREF="#DOC.2.14"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>bool <B>operator></B>(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in) const |
55 |
<DD><I>operator> only the lower bounds are used for comparison</I> |
56 |
</DL></P> |
57 |
|
58 |
</DL> |
59 |
|
60 |
<A NAME="DOC.DOCU"> |
61 |
<HR> |
62 |
<H2>Documentation</H2> |
63 |
<BLOCKQUOTE>Range is a simple class for storing one range. A range is specified by giving the minimum and maximum value for the range. Values within the range include the minimum and maximum range values, ie the ranges are inclusive. </BLOCKQUOTE> |
64 |
<DL> |
65 |
|
66 |
<A NAME="Range"> |
67 |
<A NAME="DOC.2.1"> |
68 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Range()</B></TT> |
69 |
<DD> |
70 |
Default constructor. No attempt is made to initialise the minimum or |
71 |
maximum value for the range. Min and max will have the value designated |
72 |
by their default constructor. |
73 |
<DL><DT><DD></DL><P> |
74 |
<A NAME="Range"> |
75 |
<A NAME="DOC.2.2"> |
76 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Range(const T& min, const T& max)</B></TT> |
77 |
<DD> |
78 |
Constructor. Construct a valid range with the given minimum and maximum |
79 |
value.<P>Throws RangeException if the minimum value is greater than the maximum.<P> |
80 |
<DL><DT><DT><B>Parameters:</B><DD><B>min</B> - Input - the minimum value for the range |
81 |
<BR><B>max</B> - Input - the maximum value for the range<BR><DD></DL><P> |
82 |
<A NAME="Range"> |
83 |
<A NAME="DOC.2.3"> |
84 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Range(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in)</B></TT> |
85 |
<DD> |
86 |
Copy constructor. <P>Throws RangeException if the minimum value is greater than the maximum. |
87 |
This could only happen if the input range was contructed by the default |
88 |
constructor.<P> |
89 |
<DL><DT><DT><B>Parameters:</B><DD><B>in</B> - Input - the range to copy<BR><DD></DL><P> |
90 |
<A NAME="setRange"> |
91 |
<A NAME="DOC.2.4"> |
92 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void setRange(const T& min, const T& max)</B></TT> |
93 |
<DD> |
94 |
Description: |
95 |
Set the minimum and maximum value for the range<P>Throws: |
96 |
RangeException if the minimum is greater than the maximum<P> |
97 |
<DL><DT><DT><B>Parameters:</B><DD><B>min</B> - Input - the minimum value for the range |
98 |
<BR><B>max</B> - Input - the maximum value for the range<BR><DD></DL><P> |
99 |
<A NAME="getMin"> |
100 |
<A NAME="DOC.2.5"> |
101 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>T getMin() const </B></TT> |
102 |
<DD> |
103 |
Description: |
104 |
Return the minimum value for the range<P> |
105 |
<DL><DT><DT><B>Returns:</B><DD>the minimum value for the range |
106 |
<DD></DL><P> |
107 |
<A NAME="getMax"> |
108 |
<A NAME="DOC.2.6"> |
109 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>T getMax() const </B></TT> |
110 |
<DD> |
111 |
Description: |
112 |
Return the maximum value for the range<P> |
113 |
<DL><DT><DT><B>Returns:</B><DD>the maximum value for the range |
114 |
<DD></DL><P> |
115 |
<A NAME="toString"> |
116 |
<A NAME="DOC.2.7"> |
117 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>string toString() const </B></TT> |
118 |
<DD> |
119 |
Description: |
120 |
Return a textual representation of the range.<P> |
121 |
<DL><DT><DT><B>Returns:</B><DD>textual representation of the range. |
122 |
<DD></DL><P> |
123 |
<A NAME="getDifference"> |
124 |
<A NAME="DOC.2.8"> |
125 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>T getDifference() const </B></TT> |
126 |
<DD> |
127 |
Description: |
128 |
Return the difference between rmax and rmin. Note this isn't the span |
129 |
of the range. For instance if it is an integer range from 1-5 the |
130 |
difference is 4 however the span is 5.<P> |
131 |
<DL><DT><DT><B>Returns:</B><DD>the difference between rmax and rmin |
132 |
<DD></DL><P> |
133 |
<A NAME="overlap"> |
134 |
<A NAME="DOC.2.9"> |
135 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>bool overlap(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in) const </B></TT> |
136 |
<DD> |
137 |
|
138 |
<DL><DT><DT><B>Returns:</B><DD>true if the ranges overlap |
139 |
<DT><B>Parameters:</B><DD><B>in</B> - Input - range to test for overlap |
140 |
<BR><DD></DL><P> |
141 |
<A NAME="within"> |
142 |
<A NAME="DOC.2.10"> |
143 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>bool within(const T& value) const </B></TT> |
144 |
<DD> |
145 |
|
146 |
<DL><DT><DT><B>Returns:</B><DD>true if value within the range |
147 |
<DD></DL><P> |
148 |
<A NAME="operator="> |
149 |
<A NAME="DOC.2.11"> |
150 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="Range.html#DOC.2.1">Range</A><T> & operator=(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in)</B></TT> |
151 |
<DD> |
152 |
|
153 |
<DL><DT><DD></DL><P> |
154 |
<A NAME="operator=="> |
155 |
<A NAME="DOC.2.12"> |
156 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>bool operator==(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in) const </B></TT> |
157 |
<DD> |
158 |
|
159 |
<DL><DT><DD></DL><P> |
160 |
<A NAME="operator<"> |
161 |
<A NAME="DOC.2.13"> |
162 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>bool operator<(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in) const </B></TT> |
163 |
<DD> |
164 |
|
165 |
<DL><DT><DD></DL><P> |
166 |
<A NAME="operator>"> |
167 |
<A NAME="DOC.2.14"> |
168 |
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>bool operator>(const <!1><A HREF="Range.html#DOC.2.1">Range</A><T>& in) const </B></TT> |
169 |
<DD> |
170 |
|
171 |
<DL><DT><DD></DL><P></DL> |
172 |
|
173 |
<HR><DL><DT><B>This class has no child classes.</B></DL> |
174 |
|
175 |
<DL><DT><DT><B>Version:</B><DD>0.0.1 |
176 |
|
177 |
<DT><B>See Also:</B><DD><!1><A HREF="RangeException.html">RangeException</A> |
178 |
<BR><!1><A HREF="RangeOverlapTest.html">RangeOverlapTest</A> |
179 |
<BR><!1><A HREF="RangeWithinTest.html">RangeWithinTest</A><BR><DD></DL><P><I><A HREF="index.html">Alphabetic index</A></I> <I><A HREF="HIER.html">HTML hierarchy of classes</A> or <A HREF="HIERjava.html">Java</A></I><P><HR> |
180 |
<BR> |
181 |
This page was generated with the help of <A HREF="http://www.linuxsupportline.com/~doc++">DOC++</A>. |
182 |
</BODY> |