/** * Searches this list for the specified object and returns the index of the * first occurrence. * * @param object * the object to search for. * @return the index of the first occurrence of the object, or -1 if it was * not found. */ public virtual int indexOf(Object obj) { ListIterator <E> it = listIterator(); if (obj != null) { while (it.hasNext()) { if (obj.equals(it.next())) { return(it.previousIndex()); } } } else { while (it.hasNext()) { if (it.next() == null) { return(it.previousIndex()); } } } return(-1); }
public bool hasPrevious() { return(iterator.previousIndex() >= start); }
public int previousIndex() { return(iterator.previousIndex()); }