-
Notifications
You must be signed in to change notification settings - Fork 0
Guava
illyfrancis edited this page Jul 18, 2013
·
14 revisions
- Type of collection
- Can it have duplicates?
- Is ordering significant? (for equals())
- Iteration order
- insertion-ordered? (Linked list) comparator-ordered? (Tree) user-ordered? (Array)
- something else well-defined?
- or it just doesn't matter?
In general, the first two determine the interface type, and the third tends to influce your choice of implementation
- Set: unordered equality, no dups
- List: ordered equauality, can have dups
Ordered?
Y N
Dups? +--------------+----------+
Y | List | Multiset |
+--------------+----------+
N | (UniqueList) | Set |
+--------------+----------+