Scala Library
|
|
scala/Enumeration.scala
]
abstract
class
SetXX
extends
Set[Value]object flags extends Enumeration { val Public = Value(5, "public"); val Private = Value(4, "private"); val Protected = Value(6, "protected"); val Final = Value(7, "final"); } class Entity { var flags0 : Int = ...; def flags = flags.Set32(flags0); } val e : Entity = ...; if (e.flags.contains(flags.Private)) e.flags0 = (e.flags | flags.Final).underlying;
Type Summary | |
abstract type
|
TSet <: SetXX |
abstract type
|
Underlying
<: AnyVal
either Int or Long
|
Value Summary | |
abstract val
|
underlying
: Underlying
The integer that bit-encodes a set of enumeration values.
|
Method Summary | |
abstract def
|
&
(set : TSet) : TSet
Equivalent to
* for bit sets.
Returns a bit set that has all values that are both in this and set . |
abstract def
|
&~
(value : Value) : TSet
Equivalent to
- for bit sets.
Returns a bit set that has all values in this except for value . |
def
|
** (set : TSet) : TSet |
def
|
+
(value : Value) : TSet
Create a new set with an additional element.
|
def
|
++ (set : TSet) : TSet |
def
|
-
(value : Value) : TSet
Remove a single element from a set.
|
def
|
elements
: Iterator[Value]
Creates a new iterator over all elements contained in this
object.
|
def
|
empty [B] : Set[B] |
def
|
size
: Int
Returns the number of elements in this set.
|
override def
|
stringPrefix
: java.lang.String
Defines the prefix of this object's
toString representation. |
protected abstract def
|
underlyingAsLong
: Long
returns the underlying integer representation of this set as a long.
|
abstract def
|
|
(set : TSet) : TSet
Equivalent to
++ for bit sets. Returns a set
that has all values in this and set . |
abstract def
|
|
(value : Value) : TSet
Equivalent to
+ for bit sets. Returns a set
that has all values in this with the addition of value . |
Methods inherited from Set | |
+, ++, ++, incl, incl, -, --, --, excl, excl, intersect, **, map, flatMap, filter |
Methods inherited from Set | |
contains (abstract), apply, isEmpty, subsetOf, *, equals, hashCode, toArray |
Methods inherited from Collection | |
toString |
Methods inherited from Iterable | |
concat, ++, partition, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toSeq, toStream, mkString, mkString, mkString, addString, addString, addString, copyToArray, projection, hasDefiniteSize |
Methods inherited from Function1 | |
compose, andThen |
Methods inherited from AnyRef | |
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Type Details |
Value Details |
Method Details |
protected abstract
def
underlyingAsLong : Long
++
for bit sets. Returns a set
that has all values in this
and set
.+
for bit sets. Returns a set
that has all values in this
with the addition of value
.*
for bit sets.
Returns a bit set that has all values that are both in this
and set
.-
for bit sets.
Returns a bit set that has all values in this
except for value
.elem -
the element to be removed
def
size : Int
override
def
stringPrefix : java.lang.String
toString
representation.
Scala Library
|
|