/// <summary> /// Finds all records in the page satisfying a condition /// </summary> /// <param name="Filter"></param> /// <returns></returns> public virtual int[] Seek(IRecordSeeker Filter) { List <int> idx = new List <int>(); for (int i = 0; i < this.Count; i++) { if (Filter.Equals(this._Elements[i])) { idx.Add(i); } } return(idx.ToArray()); }
/// <summary> /// Finds the last record in the page satisfying a condition /// </summary> /// <param name="Filter"></param> /// <returns></returns> public virtual int SeekLast(IRecordSeeker Filter) { int idx = this.Count - 1; while (idx >= 0) { if (Filter.Equals(this._Elements[idx])) { return(idx); } idx--; } return(Page.NULL_INDEX); }
/// <summary> /// Finds the first record in the page satisfying a condition /// </summary> /// <param name="Filter"></param> /// <returns></returns> public virtual int SeekFirst(IRecordSeeker Filter) { int idx = 0; while (idx < this.Count) { if (Filter.Equals(this._Elements[idx])) { return(idx); } idx++; } return(Page.NULL_INDEX); }