containsKey | get | put | add | remove | size | iteration | bytes per node | |
---|---|---|---|---|---|---|---|---|
ConcurrentHashMap | 1 | 1 | 1 | 1 | 1 | n (of capacity, not size) | ||
ConcurrentSkipListMap | log(n) | log(n) | log(n) | log(n) | n | n | ||
EnumMap | ||||||||
HashMap | 1 | 1 | 1 | 1 | 1 | n (of capacity, not size) | 16=3*ref + int | |
Hashtable | All accesses are synchronized. Use HashMap or ConcurrentHashMap instead. | |||||||
IdentityHashMap | ||||||||
LinkedHashMap | 1 | 1 | 1 | 1 | 1 | n (of size, not capacity) | ||
TreeMap | log(n) | log(n) | log(n) | log(n) | 1 | n | ||
WeakHashMap |
contains | get | set(i,e) add(i,e) | add(e) | remove | size | iteration | bytes per node | |
---|---|---|---|---|---|---|---|---|
ArrayBlockingQueue | ||||||||
ArrayDeque | ||||||||
ArrayList | n | 1 | 1 (n if resizing) | 1 (n if resizing) | n | 1 | n | 0 |
ConcurrentLinkedQueue | ||||||||
ConcurrentSkipListSet | ||||||||
CopyOnWriteArrayList | ||||||||
CopyOnWriteArraySet | ||||||||
DelayQueue | ||||||||
EnumSet | ||||||||
HashSet (based on HashMap) | 1 | 1 | 1 | 1 | 1 | n (of capacity, not size) | 16=3*ref + int | |
LinkedBlockingDeque | ||||||||
LinkedBlockingQueue | ||||||||
LinkedHashSet | ||||||||
LinkedList | n | n | n | 1 | n (removal is 1 at either end of the list) | 1 | n | 12 = 3*ref |
PriorityBlockingQueue | ||||||||
PriorityQueue | ||||||||
Stack | Extends Vector. Use ArrayDeque instead. | |||||||
SynchronousQueue | ||||||||
TreeSet | log(n) | log(n) | log(n) | log(n) | log(n) | 1 | n | |
Vector | All accesses are synchronized. Use ArrayList instead. |
Version 14.1 last modified by Geoff Fortytwo on 11/07/2010 at 17:21
Document data
Attachments:
No attachments for this document