ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Java API 분석__ Interface List
    개발입문/자료구조 2017. 7. 24. 15:34


    List Interface


    public interface List<E>

    extends Collection<E>


    An ordered collection (also known as a sequence). The user of this interface has precise control over where in the list each element is inserted. The user can access elements by their integer index (position in the list), and search for elements in the list. Unlike sets, lists typically allow duplicate elements. 



    Superinterfaces:

    Collection<E>, Iterable<E>


    Known Implementing Classes:

    AbstractList, ArrayList, LinkedList, Stack, Vector


    - 순서가 있는 컬렉션 (시퀀스)

    - 정수형 인덱스 값으로 원소에 접근할 수 있다.



    Methods


    Ordered List 속성에 따라 

    'index' 로 원소에 접근하는 메소드들이 많다. 

    아직 익숙하지 않은 Iterator, 그 중에서도 ListIterator 와 파티셔닝까지 하는 Spliterator 까지 보인다. 



    positional (indexed) access to list elements. 

    add(int index, E element)

    addAll(int index, Collection<? extends E> c)

    get(int index)

    remove(int index)

    set(int index, E element)

           subList(int fromIndex, int toIndex)



     to search for a specified object. 

    indexOf(Object o)

    lastIndexOf(Object o)

    contains(Object o)

    remove(Object o)



    a special iterator, called a ListIterator and Spliterator

    iterator()

    listIterator()

    listIterator(int index)

    spliterator()




    Implementing Classes 

    AbstractList, ArrayList, LinkedList, Stack, Vector 정도 훑어봐야지!


    댓글

Designed by Tistory.