DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | Private Member Functions | List of all members
Deveel.Data.Index.IndexRange Struct Reference

Describes the range of values to select from an index. More...

Public Member Functions

 IndexRange (RangeFieldOffset startOffset, DataObject firstValue, RangeFieldOffset lastOffset, DataObject endValue)
 Constructs the range given a start and an end location More...
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 

Static Public Member Functions

static bool operator== (IndexRange a, IndexRange b)
 
static bool operator!= (IndexRange a, IndexRange b)
 

Static Public Attributes

static readonly DataObject FirstInSet = new DataObject(PrimitiveTypes.Null(), new SqlString("FirstInSet"))
 
static readonly DataObject LastInSet = new DataObject(PrimitiveTypes.Null(), new SqlString("LastInSet"))
 
static readonly IndexRange FullRange
 The entire range of values in an index (including NULL) More...
 
static readonly IndexRange FullRangeNotNull
 The entire range of values in an index (not including NULL) More...
 
static readonly IndexRange Null = new IndexRange(true)
 

Properties

bool IsNull [get, private set]
 
RangeFieldOffset StartOffset [get, private set]
 Gets the offset of the first value of the range. More...
 
DataObject StartValue [get, private set]
 Gets the first value of the range. More...
 
RangeFieldOffset EndOffset [get, private set]
 Gets the offset of the last value of the range. More...
 
DataObject EndValue [get, private set]
 Gets the last value of the range. More...
 

Private Member Functions

 IndexRange (bool isNull)
 

Detailed Description

Describes the range of values to select from an index.

A range has a start value, an end value, and whether we should pick inclusive or exclusive of the end value. The start value may be a concrete value from the set or it may be a flag that represents the start or end of the list.

Note that the the start value may not compare less than the end value. For example, start can not be RangeFieldOffset.LastValue and end can not be RangeFieldOffset.FirstValue.

Definition at line 38 of file IndexRange.cs.

Constructor & Destructor Documentation

Deveel.Data.Index.IndexRange.IndexRange ( RangeFieldOffset  startOffset,
DataObject  firstValue,
RangeFieldOffset  lastOffset,
DataObject  endValue 
)
inline

Constructs the range given a start and an end location

Parameters
startOffsetThe offset of the first value of the range.
firstValueThe first value of the range
lastOffsetThe offset within the range of the last value.
endValueThe last value of the range.

Definition at line 56 of file IndexRange.cs.

57  : this(false) {
58  StartOffset = startOffset;
59  StartValue = firstValue;
60  EndOffset = lastOffset;
61  EndValue = endValue;
62  }
DataObject EndValue
Gets the last value of the range.
Definition: IndexRange.cs:103
RangeFieldOffset EndOffset
Gets the offset of the last value of the range.
Definition: IndexRange.cs:98
DataObject StartValue
Gets the first value of the range.
Definition: IndexRange.cs:93
RangeFieldOffset StartOffset
Gets the offset of the first value of the range.
Definition: IndexRange.cs:88
Deveel.Data.Index.IndexRange.IndexRange ( bool  isNull)
inlineprivate

Definition at line 64 of file IndexRange.cs.

65  : this() {
66  IsNull = isNull;
67  }

Member Function Documentation

override bool Deveel.Data.Index.IndexRange.Equals ( object  obj)
inline

Definition at line 106 of file IndexRange.cs.

106  {
107  var destRange = (IndexRange)obj;
108  if (IsNull && destRange.IsNull)
109  return true;
110  if (IsNull && !destRange.IsNull)
111  return false;
112  if (!IsNull && destRange.IsNull)
113  return false;
114 
115  return (StartValue.Value.Equals(destRange.StartValue.Value) &&
116  EndValue.Value.Equals(destRange.EndValue.Value) &&
117  StartOffset == destRange.StartOffset &&
118  EndOffset == destRange.EndOffset);
119  }
DataObject EndValue
Gets the last value of the range.
Definition: IndexRange.cs:103
ISqlObject Value
Gets the underlined value that is handled.
Definition: DataObject.cs:84
IndexRange(RangeFieldOffset startOffset, DataObject firstValue, RangeFieldOffset lastOffset, DataObject endValue)
Constructs the range given a start and an end location
Definition: IndexRange.cs:56
RangeFieldOffset EndOffset
Gets the offset of the last value of the range.
Definition: IndexRange.cs:98
DataObject StartValue
Gets the first value of the range.
Definition: IndexRange.cs:93
RangeFieldOffset StartOffset
Gets the offset of the first value of the range.
Definition: IndexRange.cs:88
override int Deveel.Data.Index.IndexRange.GetHashCode ( )
inline

Definition at line 122 of file IndexRange.cs.

122  {
123  return base.GetHashCode();
124  }
static bool Deveel.Data.Index.IndexRange.operator!= ( IndexRange  a,
IndexRange  b 
)
inlinestatic

Definition at line 150 of file IndexRange.cs.

150  {
151  return !(a == b);
152  }
static bool Deveel.Data.Index.IndexRange.operator== ( IndexRange  a,
IndexRange  b 
)
inlinestatic

Definition at line 146 of file IndexRange.cs.

146  {
147  return a.Equals(b);
148  }
override string Deveel.Data.Index.IndexRange.ToString ( )
inline

Definition at line 127 of file IndexRange.cs.

127  {
128  var sb = new StringBuilder();
129  if (StartOffset == RangeFieldOffset.FirstValue) {
130  sb.Append("FIRST_VALUE ");
131  } else if (StartOffset == RangeFieldOffset.AfterLastValue) {
132  sb.Append("AFTER_LAST_VALUE ");
133  }
134 
135  sb.Append(StartValue.ToString());
136  sb.Append(" -> ");
137  if (EndOffset == RangeFieldOffset.LastValue) {
138  sb.Append("LAST_VALUE ");
139  } else if (EndOffset == RangeFieldOffset.BeforeFirstValue) {
140  sb.Append("BEFORE_FIRST_VALUE ");
141  }
142  sb.Append(EndValue.ToString());
143  return sb.ToString();
144  }
DataObject EndValue
Gets the last value of the range.
Definition: IndexRange.cs:103
RangeFieldOffset EndOffset
Gets the offset of the last value of the range.
Definition: IndexRange.cs:98
DataObject StartValue
Gets the first value of the range.
Definition: IndexRange.cs:93
RangeFieldOffset
The absolute offset of a field in a range of a selection.
RangeFieldOffset StartOffset
Gets the offset of the first value of the range.
Definition: IndexRange.cs:88

Member Data Documentation

readonly DataObject Deveel.Data.Index.IndexRange.FirstInSet = new DataObject(PrimitiveTypes.Null(), new SqlString("FirstInSet"))
static

Definition at line 42 of file IndexRange.cs.

readonly IndexRange Deveel.Data.Index.IndexRange.FullRange
static
Initial value:

The entire range of values in an index (including NULL)

Definition at line 74 of file IndexRange.cs.

readonly IndexRange Deveel.Data.Index.IndexRange.FullRangeNotNull
static
Initial value:
= new IndexRange(RangeFieldOffset.AfterLastValue, DataObject.Null(),

The entire range of values in an index (not including NULL)

Definition at line 80 of file IndexRange.cs.

readonly DataObject Deveel.Data.Index.IndexRange.LastInSet = new DataObject(PrimitiveTypes.Null(), new SqlString("LastInSet"))
static

Definition at line 47 of file IndexRange.cs.

readonly IndexRange Deveel.Data.Index.IndexRange.Null = new IndexRange(true)
static

Definition at line 83 of file IndexRange.cs.

Property Documentation

RangeFieldOffset Deveel.Data.Index.IndexRange.EndOffset
getprivate set

Gets the offset of the last value of the range.

Definition at line 98 of file IndexRange.cs.

DataObject Deveel.Data.Index.IndexRange.EndValue
getprivate set

Gets the last value of the range.

Definition at line 103 of file IndexRange.cs.

bool Deveel.Data.Index.IndexRange.IsNull
getprivate set

Definition at line 69 of file IndexRange.cs.

RangeFieldOffset Deveel.Data.Index.IndexRange.StartOffset
getprivate set

Gets the offset of the first value of the range.

Definition at line 88 of file IndexRange.cs.

DataObject Deveel.Data.Index.IndexRange.StartValue
getprivate set

Gets the first value of the range.

Definition at line 93 of file IndexRange.cs.


The documentation for this struct was generated from the following file: