Abstract
The collections framework in Scala is a high-performance and type-parametrized framework with support for mutable and immutable type hierarchies. These distinct and independent mutable and immutable type hierarchies enable switching between mutable and immutable implementations much simpler. Scala’s object-oriented collections also support functional higher-order operations such as map, filter, and reduce that let you use expression-oriented programming in collections. You can access and use the entire Java collections library from your Scala code because Scala is a JVM language, but this is not recommended because higher-order operations are not available with Java Collections library. Scala has a rich collection library. This chapter gives you a tour of the most commonly used collection types and operations, showing just the types you will use most frequently. The goal of this chapter is to guide you through the myriad of options to find the solutions you need.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
You can see exactly how Scala turns patterns into code by typing scalac -print FileName.scala. This will cause the Scala compiler to emit desugared code that looks strangely like Java code.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2015 Vishal Layka
About this chapter
Cite this chapter
Layka, V., Pollak, D. (2015). Scala Collections. In: Beginning Scala. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0232-6_6
Download citation
DOI: https://doi.org/10.1007/978-1-4842-0232-6_6
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-0233-3
Online ISBN: 978-1-4842-0232-6
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)