private List4 Find(object obj) { List4 current = _first; while (current != null) { if (current.Holds(obj)) { return(current); } current = ((List4)current._next); } return(null); }
public virtual int IndexOf(object obj) { int index = 0; List4 current = _first; while (current != null) { if (current.Holds(obj)) { return(index); } index++; current = ((List4)current._next); } return(-1); }
/// <summary> /// removes an object from the Collection equals() comparison returns the /// removed object or null, if none found /// </summary> public virtual bool Remove(object a_object) { List4 previous = null; List4 current = _first; while (current != null) { if (current.Holds(a_object)) { _size--; AdjustOnRemoval(previous, current); Changed(); return(true); } previous = current; current = ((List4)current._next); } return(false); }