You are previewing Scala for the Impatient.

Scala for the Impatient

Cover of Scala for the Impatient by Cay S. Horstmann Published by Addison-Wesley Professional
O'Reilly logo

Chapter 14. Pattern Matching and Case Classes

Topics in This Chapter image

14.1 A Better Switch — page 184

14.2 Guards — page 185

14.3 Variables in Patterns — page 185

14.4 Type Patterns — page 186

14.5 Matching Arrays, Lists, and Tuples — page 187

14.6 Extractors — page 188

14.7 Patterns in Variable Declarations — page 188

14.8 Patterns in for Expressions — page 189

14.9 Case Classes — page 189

14.10 The copy Method and Named Parameters — page 190

14.11 Infix Notation in case Clauses — page 191

14.12 Matching Nested Structures — page 192

14.13 Are Case Classes Evil? — page 192

14.14 Sealed Classes — page 193

14.15 Simulating ...

The best content for your career. Discover unlimited learning on demand for around $1/day.