- 1 package java.util;
- 2
- 3 public interfaceList extendsCollection {
- 4 // Query Operations
- 5 int size();
- 6
- 7 boolean isEmpty();
- 8
- 9 boolean contains(Object o);
- 10
- 11Iterator iterator();
- 12
- 13 Object[] toArray();
- 14
- 15 T[] toArray(T[] a);
- 16
- 17
- 18 // Modification Operations
- 19 boolean add(E e);
- 20
- 21 boolean remove(Object o);
- 22
- 23
- 24 // Bulk Modification Operations
- 25 booleancontainsAll(Collection c);
- 26
- 27 booleanaddAll(CollectionextendsE> c);
- 28
- 29 booleanaddAll(intindex, CollectionextendsE> c);
- 30
- 31 booleanremoveAll(Collection c);
- 32
- 33 booleanretainAll(Collection c);
- 34
- 35 void clear();
- 36
- 37
- 38 // Comparison and hashing
- 39 boolean equals(Object o);
- 40
- 41 int hashCode();
- 42
- 43
- 44 // Positional Access Operations
- 45E get(int index);
- 46
- 47E set(int index, E element);
- 48
- 49 voidadd(int index, E element);
- 50
- 51E remove(int index);
- 52
- 53
- 54 // Search Operations
- 55
- 56 int indexOf(Object o);
- 57
- 58 int lastIndexOf(Object o);
- 59
- 60
- 61 // List Iterators
- 62ListIterator listIterator();
- 63
- 64ListIterator listIterator(int index);
- 65
- 66 // View
- 67List subList(intfromIndex,int toIndex);
- 68}
来源: