2using System.Collections.Generic;
4using System.Threading.Tasks;
13 private readonly
string fieldName;
17 private bool minInclusive;
18 private bool maxInclusive;
39 public object Min => this.min;
44 public object Max => this.max;
49 public object Point => this.point;
76 get {
return this.IsRange && (this.min is
null || this.max is
null); }
84 get {
return (this.isRange && !(this.min is
null)) || (this.isPoint && !(this.point is
null)); }
92 get {
return (this.isRange && !(this.max is
null)) || (this.isPoint && !(this.point is
null)); }
106 if (!(this.min is
null))
110 if (!i.HasValue || i.Value > 0 || (i.Value == 0 && !
this.minInclusive))
116 if (!(this.max is
null))
120 if (!i.HasValue || i.Value < 0 || (i.Value == 0 && !
this.maxInclusive))
127 this.isRange =
false;
131 else if (this.isPoint)
134 return (i.HasValue && i.Value == 0);
151 public bool SetMin(
object Value,
bool Inclusive, out
bool Smaller)
159 if (!(this.min is
null))
170 if (!this.minInclusive && Inclusive)
175 if (i.HasValue && i.Value == 0)
181 this.minInclusive = Inclusive;
183 else if (i.Value == 0)
185 if (!Inclusive && this.minInclusive)
187 this.minInclusive =
false;
195 this.minInclusive = Inclusive;
199 if (!(this.max is
null))
202 if (!i.HasValue || i.Value < 0)
204 else if (i.Value == 0)
206 if (!(this.minInclusive && this.maxInclusive))
211 this.isRange =
false;
219 else if (this.isPoint)
223 return !(!i.HasValue || i.Value < 0 || (i.Value == 0 && !Inclusive));
228 this.minInclusive = Inclusive;
242 public bool SetMax(
object Value,
bool Inclusive, out
bool Smaller)
250 if (!(this.max is
null))
261 if (!this.maxInclusive && Inclusive)
266 if (i.HasValue && i.Value == 0)
272 this.maxInclusive = Inclusive;
274 else if (i.Value == 0)
276 if (!Inclusive && this.maxInclusive)
278 this.maxInclusive =
false;
286 this.maxInclusive = Inclusive;
290 if (!(this.min is
null))
293 if (!i.HasValue || i.Value < 0)
295 else if (i.Value == 0)
297 if (!(this.minInclusive && this.maxInclusive))
302 this.isRange =
false;
310 else if (this.isPoint)
314 return !(!i.HasValue || i.Value > 0 || (i.Value == 0 && !Inclusive));
319 this.maxInclusive = Inclusive;
343 Destination.min = this.min;
344 Destination.max = this.max;
345 Destination.point = this.point;
346 Destination.minInclusive = this.minInclusive;
347 Destination.maxInclusive = this.maxInclusive;
348 Destination.isRange = this.isRange;
349 Destination.isPoint = this.isPoint;
Static class that performs comparisons of property values.
static bool Decrement(ref object Value)
Decrements Value to the largest value smaller than Value .
static ? int Compare(object Value1, object Value2)
Compares two values. The values can be of different, but compatible types.
static bool Increment(ref object Value)
Increments Value to the smallest value greater than Value .
Contains information about a range in a search operation.
bool HasMin
If the range has a minimum endpoint.
RangeInfo(string FieldName)
Contains information about a range in a search operation.
object Max
Maximum endpoint, if a range.
bool MinInclusive
If the minimum endpoint is included in the range.
bool SetMin(object Value, bool Inclusive, out bool Smaller)
Sets minimum endpoint of range.
bool SetMax(object Value, bool Inclusive, out bool Smaller)
Sets maximum endpoint of range.
string FieldName
Field Name
object Min
Minimum endpoint, if a range.
void CopyTo(RangeInfo Destination)
Copies the range information to another range object.
object Point
Point value, if not a range.
bool IsRange
If the object specifies a range (true) or a single point (false).
bool IsOpenEndedRange
If the range is open-ended.
RangeInfo Copy()
Creates a copy of the range information.
bool IsPoint
If the object specifies a point (true) or a range (false).
bool HasMax
If the range has a maximum endpoint.
bool SetPoint(object Value)
Range consists of a single point value.
bool MaxInclusive
If the maximum endpoint is included in the range.