개발입문/자료구조

Java API 분석__ Interface Collection

haloaround 2017. 7. 24. 14:58

Collection Framework

Data Structure 자료 구조 API 차근히 읽기 


복습하면서 API를 다시 차근히 읽고~

Collection Frameworks Tutorial 을 숙지한 다음에

Algorithm 으로 넘어갈꺼다!! 



1. Collection Interface 


public interface Collection<E>

extends Iterable<E>


The root interface in the collection hierarchy. A collection represents a group of objects, known as its elements. Some collections allow duplicate elements and others do not. Some are ordered and others unordered. The JDK does not provide any direct implementations of this interface: it provides implementations of more specific subinterfaces like Set and List. This interface is typically used to pass collections around and manipulate them where maximum generality is desired.


- 컬렉션 위계구조의 루트 인터페이스

- 목록형 데이터: 여러개의 객체를 하나의 객체에 담아 처리할 때의 메소드(기능) 을 지정

- Set, List 등 더 구체적인 인터페이스를 구현하여 자료구조를 표현 가능
- 컬렉션을 전달하고 조작하는데 사용된다.


컬렉션 인터페이스의 본문은  컬렉션 및 컬렉션 하위 인터페이스 List, Set, Queue 를 구현한 자료구조 클래스가 어떤 기능성과 목적 때문에 분류되었는지 설명하고 있다. 컬렉션 인터페이스를 구현한 클래스들은 일반적으로 <구현스타일 + 인터페이스> 으로 명명된다.
아래 테이블에 각 구현의 목적이 요약되어있다.

Interface

Hash Table

Resizable Array

Balanced Tree

Linked List

Hash Table + Linked List

Set

HashSet

 

TreeSet

 

LinkedHashSet

List

 

ArrayList

 

LinkedList

 

Deque

 

ArrayDeque

 

LinkedList

 

Map

HashMap

 

TreeMap

 

LinkedHashMap






Collection 의 주요 자료구조형


순서가 있는 List

순서가 중요하지 않은  Set

먼저 들어온 것이 먼저 나가는 Queue

키-값(key-value) 으로 저장되는 Map








나중에 Collections FrameWork Tutorials 를 꼭 처음부터 끝까지 읽을거다!

https://docs.oracle.com/javase/tutorial/collections/