Java Reference
In-Depth Information
Returns the index of the first object in the list that is equal to
elem , or that is null if elem is null . Returns 1 if no match is
found.
public int lastIndexOf(Object elem)
Returns the index of the last object in the list that is equal to
elem , or that is null if elem is null . Returns 1 if no match is
found.
public List<E> subList(int min, int max)
Returns a List that is a view on this list over the range, start-
ing with min up to, but not including, max . For example, sub-
List(1,5) would return a list containing elements number 1,
2, 3, and 4 from this list. The returned list is backed by this
list, so changes made to the returned list are reflected in this
list. Changes made directly to the backing list are not guar-
anteed to be visible to a sublist and can cause undefined res-
ults (so don't do it). Sublists allow you to do anything to part
of a list that you could to do an entire list, so they can be a
powerful tool. For example, you can remove part of a list us-
ing list.subList(min,max).clear() .
public ListIterator<E> listIterator(int index)
Returns a ListIterator object that will iterate through the ele-
ments of the list starting at the index th entry.
public ListIterator<E> listIterator()
Returns a ListIterator object that will iterate through the ele-
ments of the list starting at the beginning.
All the methods that take an index will throw IndexOutOfBoundsException if
index is less than zero or greater than or equal to the list's size.
 
Search WWH ::




Custom Search