Exemplo n.º 1
0
        /// <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());
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        /// <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);
        }