Beruflich Dokumente
Kultur Dokumente
Richard Warburton
@richardwarburto | www.insightfullogic.com
Collection of Interface vs
Collection Behaviors
Collections Implementation
The Collection of Collections
Collection
List Map
Set Queue
ArrayList HashMap
HashSet PriorityQueue
LinkedList
Deque
SortedSet SortedMap
LinkedList
TreeSet TreeMap
ArrayDeque
Set Elements are Keyed? Map
Yes
No
No
No
Order is Important? Order is Important?
Yes Yes
Yes
No
Last In, First Out? First In, First Out?
No
Yes Yes
Yes
List Deque Queue
Collection Behaviors
Iteration, Sizing and Mutation
Iterable
Iterator
Collection
Outline of Collection Interface
size() Get the number of elements in the Collection
addAll(collection) Add all the elements of the argument collection to this collection
removeAll(collection) Remove all the elements of the argument collection to this collection
retainAll(collection) Remove all the elements of this collection not in the argument collection
containsAll(collection) True if all the elements of the argument collection are in this collection
clear() Remove all elements from this collection
Summary