![]() New collections are created like this: scala> val seq = Seq( 1, 2, 3, 4, 1) They can be used directly as shown below since their companion objects areĪll available as type aliases in either the scala package or in The three most commonly used collections are The most common way to create a collection is to use its companion object asĪ factory. Res1: List = List( 1, 2, 3, 4, 5, 6) Creating Collections The methods that transform collections will return a collection of the same These traits define the vast majority of operationsĬollections can, of course, be treated as specifically as needed, and It is convenient to treat all collections as eitherĪ or, as GuideĪ detailed guide for using the collections library is availableĭevelopers looking to extend the collections library can find a description Definition Classes rootĬontains the base traits and objects needed to use and extend Scala's collection library. For example, on the JVM, String is an alias for. Other aliases refer to classes provided by the underlying platform. Some of these identifiers are type aliases provided as shortcuts to commonly used classes. Identifiers in the scala package and the scala.Predef object are always in scope by default. - Parser combinators (scala-parser-combinators.jar).scala.swing - A convenient wrapper around Java's GUI framework called Swing (scala-swing.jar).scala.xml - XML parsing, manipulation, and serialization (scala-xml.jar).scala.reflect - Scala's reflection API (scala-reflect.jar).See the complete list on the right.Īdditional parts of the standard library are shipped as separate libraries. scala.sys - Interaction with other processes and the operating system.scala.math - Basic math functions and additional numeric types like.ncurrent - Primitives for concurrent programming such as.- Mutable, concurrent data-structures such as.- Mutable, sequential data-structures such as. ![]()
0 Comments
Leave a Reply. |