메소드 | 반환 타입 | 설명 | .. |
add(E e) | boolean | 리스트의 끝에 요소를 추가 요소가 추가됐는지 여부를 boolean타입으로 리턴 |
add(int index, E element) : index에 요소 추가, void 리턴 |
addAll(Collection<? extends E> c) | boolean | 리스트의 끝에 콜렉션 추가 요소가 추가됐는지 여부를 boolean타입으로 리턴 |
addAll(int index, Collection<? extends E> c) : index에 콜렉션 추가, boolean 리턴 |
clear() | void | 리스트의 모든 요소 제거 | |
clone() | Object | 리스트 인스턴스의 얕은 복사본을 반환 | |
contains(Object o) | boolean | 리스트에 해당 요소가 있는지 여부를 반환 | |
ensureCapacity (int minCapacity) |
void | 리스트 인스턴스의 용량을 늘림 | |
forEach(Consumer<? super E> action) | void | Iterable의 각 요소에 대해 지정된 작업을 수행 | 모든 요소가 처리되거나 작업이 예외를 throw 할 때까지 수행 |
get(int index) | E | 해당 인덱스의 요소를 반환 | |
indexOf(Object o) | int | 해당 요소가 처음으로 등장하는 인덱스 반환 | 요소를 포함하고 있지 않다면 -1 반환 lastIndexOf(Object o) : 요소가 등장하는 마지막 인덱스 반환 |
isEmpty() | boolean | 리스트에 요소가 1개도 없다면 true 리턴 | |
iterator() | Iterator<E> | 리스트의 요소에 대한 iterator을 적절한 순서로 반환 | |
listIterator() | ListIterator<E> | 리스트의 요소에 대한 listIterator를 적절한 순서로 반환 | listIterator(int index): 특정 인덱스 부터 listIterator로 반환 |
remove(int index) | E | 특정 인덱스의 요소를 제거하고 제거한 요소 반환 | remove(Object o): 지정한 요소가 처음으로 등장하는 요소를 제거, 지정된 요소가 포함되있는지 여부를 boolean으로 리턴 |
removeAll(Collection<?> c) | boolean | 지정된 컬렉션에 포함된 모든 요소를 리스트에서 제거 | |
removeIf(Predicate<? super E> filter) | boolean | 람다식으로 전달한 조건에 맞는 요소를 필터링하여 제거, 제거된 요소가 있는지 여부 반환 | |
removeRange(int fromIndex, int toIndex) | protected void | fromIndex를 포함한 요소부터 toIndex까지(toIndex는 제외한) 범위의 요소 제거 | |
replaceAll(unaryOperator<E> operator) | void | 리스트의 각 요소를 요소에 연산자를 적용한 결과로 바꿈 | |
retainAll(Collection<?> c) | boolean | 리스트에서 지정된 컬렉션에 포함된 요소만 유지함 변경됐는지 여부 리턴 |
|
set(int index, E element) | E | 리스트의 지정된 인덱스에 있는 요소를 지정된 요소로 변환하고 이전 요소를 반환 | |
size() | int | 리스트의 요소 개수를 반환 | |
sort(Comparator<? super E> c) | void | Comparator에 지정된 순서로 리스트 정렬 | |
spliterator() | Spliterator<E> | 리스트의 요소에 fail-fast Spliterator 및 late-binding을 만듬 | |
subList(int fromIndex, int toIndex) | List<E> | 지정된 fromIndex(포함)와 toIndex(제외) 사이의 부분 보기를 반환 | |
toArray() | Object[] | 리스트를 배열로 반환 | |
trimToSize() | void | 리스트의 인스턴스 용량을 목록의 현재 크기로 자름 |
<공식 doc>
https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html
ArrayList (Java Platform SE 8 )
Resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null. In addition to implementing the List interface, this class provides methods to manipulate the size of the array that is
docs.oracle.com