Esempio n. 1
0
        public int FindIndex(int startIndex, int count, Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            this.CheckRange(startIndex, count);
            return(this.GetIndex(startIndex, count, match));
        }
Esempio n. 2
0
        public int FindLastIndex(int startIndex, Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            this.CheckIndex(startIndex);
            return(this.GetLastIndex(0, startIndex + 1, match));
        }
Esempio n. 3
0
        public int FindIndex(int startIndex, Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            this.CheckIndex(startIndex);
            return(this.GetIndex(startIndex, this.Count - startIndex, match));
        }
Esempio n. 4
0
        public int RemoveAll(Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            int i;

            for (i = 0; i < this.Count; i++)
            {
                if (match.Invoke(this.Items[i]))
                {
                    break;
                }
            }
            if (i == this.Count)
            {
                return(0);
            }
            this.version++;
            int j;

            for (j = i + 1; j < this.Count; j++)
            {
                if (!match.Invoke(this.Items[j]))
                {
                    this.Items[i++] = this.Items[j];
                }
            }
            if (j - i > 0)
            {
                Array.Clear(this.Items, i, j - i);
            }
            this.Count = i;
            return(j - i);
        }
Esempio n. 5
0
        public T FindLast(Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            int index = this.GetLastIndex(0, this.Count, match);

            return((index != -1) ? this.Items[index] : default(T));
        }
Esempio n. 6
0
        public T Find(Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            int index = this.GetIndex(0, this.Count, match);

            return((index == -1) ? default(T) : this.Items[index]);
        }
Esempio n. 7
0
        public int FindLastIndex(int startIndex, int count, Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            int index = (startIndex - count) + 1;

            this.CheckRange(index, count);
            return(this.GetLastIndex(index, count, match));
        }
Esempio n. 8
0
        public bool TrueForAll(Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            for (int i = 0; i < this.Count; i++)
            {
                if (!match(this.Items[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 9
0
        public int RemoveAll(Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            int index = 0;
            int num2  = 0;

            index = 0;
            while (index < this.Count)
            {
                if (match(this.Items[index]))
                {
                    break;
                }
                index++;
            }
            if (index == this.Count)
            {
                return(0);
            }
            this.version++;
            num2 = index + 1;
            while (num2 < this.Count)
            {
                if (!match(this.Items[num2]))
                {
                    this.Items[index++] = this.Items[num2];
                }
                num2++;
            }
            if ((num2 - index) > 0)
            {
                Array.Clear(this.Items, index, num2 - index);
            }
            this.Count = index;
            return(num2 - index);
        }
Esempio n. 10
0
        public int FindLastIndex(Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            return(this.GetLastIndex(0, this.Count, match));
        }
Esempio n. 11
0
        public ExposedList <T> FindAll(Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            return(this.FindAllList(match));
        }
Esempio n. 12
0
        public bool Exists(Predicate <T> match)
        {
            ExposedList <T> .CheckMatch(match);

            return(this.GetIndex(0, this.Count, match) != -1);
        }