~/talk

Collections Corner Cases

Talkat Devoxx Belgium 2019 · 2019-11-04..11-08· [java]
slides:none on file

Demos use JShell and real JDK APIs to show that map views (keySet, values, entrySet) are view collections backed by map so set/collection operations write through and can remove entries; bulk ops like removeIf and entry.setValue mutate the underlying map. A nested-stream solution for finding keys by common values hits N^2 on 15,000 entries; replacing contains with a HashSet of A’s values reduces it to linear and uses retainAll to compute intersection. Sorted collections use comparators, and a comparator inconsistency with equals makes TreeSet drop “duplicates” (e.g., equal salaries), breaking Set semantics.

AI-written summary · about

  1. 0:00Intro
  2. 0:41Overview
  3. 1:53View Collections
  4. 2:48List View of Array
  5. 7:58Map Key Set View
  6. 8:34Map Values View
  7. 8:48Map Entry-set View
  8. 16:46Extended Map Views Example
  9. 24:33Solution Attempt #3
  10. 27:32Iteration Order
  11. 34:13Set Membership
  12. 45:45Explanation
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.