public int FindIndex(int startIndex, int count, Predicate <T> match) { ExposedList <T> .CheckMatch(match); this.CheckRange(startIndex, count); return(this.GetIndex(startIndex, count, match)); }
public int FindLastIndex(int startIndex, Predicate <T> match) { ExposedList <T> .CheckMatch(match); this.CheckIndex(startIndex); return(this.GetLastIndex(0, startIndex + 1, match)); }
public int FindIndex(int startIndex, Predicate <T> match) { ExposedList <T> .CheckMatch(match); this.CheckIndex(startIndex); return(this.GetIndex(startIndex, this.Count - startIndex, match)); }
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); }
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)); }
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]); }
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)); }
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); }
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); }
public int FindLastIndex(Predicate <T> match) { ExposedList <T> .CheckMatch(match); return(this.GetLastIndex(0, this.Count, match)); }
public ExposedList <T> FindAll(Predicate <T> match) { ExposedList <T> .CheckMatch(match); return(this.FindAllList(match)); }
public bool Exists(Predicate <T> match) { ExposedList <T> .CheckMatch(match); return(this.GetIndex(0, this.Count, match) != -1); }