|
Scala 2.1.7
|
class
Enumeration
extends
java.lang.Object with
scala.ScalaObjectThe class Enumeration
provides the same functionality as the
enum
construct found in C-like languages like C++ or Java.
Here is an example:
object Main with Application { object WeekDays extends Enumeration { val Mon, Tue, Wed, Thu, Fri, Sat, Sun = Value } def isWorkingDay(d: WeekDays.Value) = ! (d == WeekDays.Sat || d == WeekDays.Sun); WeekDays filter (isWorkingDay) foreach { d => System.out.println(d) } }
Constructor Summary | |
def
this
|
|
def
this
( initial : scala.Int , names : java.lang.String* )
|
|
def
this
( names : java.lang.String* )
|
Class Summary | |
protected
|
class
Val
|
abstract
|
class
Value
|
Constructor Detail |
def
this
def
this
( initial : scala.Int , names : java.lang.String* )
def
this
( names : java.lang.String* )
Def Detail |
def
Value
( i : scala.Int ) : Enumeration.this.Value
def
Value
( i : scala.Int , name : java.lang.String ) : Enumeration.this.Value
def
Value
( name : java.lang.String ) : Enumeration.this.Value
def
Value
: Enumeration.this.Value
def
apply
( x : scala.Int ) : Enumeration.this.Value
def
elements
: scala.Iterator[Enumeration.this.Value]
def
exists
( p : (Enumeration.this.Value) => scala.Boolean ) : scala.Boolean
def
filter
( p : (Enumeration.this.Value) => scala.Boolean ) : scala.Iterator[Enumeration.this.Value]
def
flatMap
[ b ]( f : (Enumeration.this.Value) => scala.Iterator[b] ) : scala.Iterator[b]
def
forall
( p : (Enumeration.this.Value) => scala.Boolean ) : scala.Boolean
def
foreach
( f : (Enumeration.this.Value) => scala.Unit ) : scala.Unit
def
map
[ b ]( f : (Enumeration.this.Value) => b ) : scala.Iterator[b]
def
maxId
: scala.Int
def
name
: java.lang.String
def
toString
: java.lang.String