Often, the extractor object also defines a dual method apply for building values, but this is not required.
If you want to change selection, open document below and click on "Move attachment"
Scala Extractors Who
Scala Extractors
Advertisements
Previous Page
Next Page
An extractor in Scala is an object that has a method called unapply as one of its members. The purpose of that unapply method is to match a value and take it apart. <span>Often, the extractor object also defines a dual method apply for building values, but this is not required.
Following example shows an extractor object for email addresses:
object Test {
def main(args: Array[String]) {
println ("Apply method : " + apply("Zara&quo
Summary
status
not read
reprioritisations
last reprioritisation on
suggested re-reading day
started reading on
finished reading on
Details
Discussion
Do you want to join discussion? Click here to log in or create user.