|
Scala
1.2.0.1 |
|||
empty
has
to be redefined if the immutable set on which this mutable set is
originally based is not empty. empty
is supposed to
return the representation of an empty set.
Method Summary | |
def +=(elem: A): Unit
This method adds a new element to the set. |
|
def -=(elem: A): Unit
-= can be used to remove a single element from
a set.
|
|
def clear: Unit
Removes all elements from the set. |
|
def contains(elem: A): Boolean
Checks if this set contains element elem .
|
|
def elements: Iterator[A]
Creates a new iterator over all elements contained in this object. |
|
protected
|
def empty: Set[A]
|
override
|
def exists(p: (A) => Boolean): Boolean
Apply a predicate p to all elements of this
iterable object and return true, iff there is at least one
element for which p yields true.
|
override
|
def foreach(f: (A) => Unit): Unit
Apply a function f to all elements of this
iterable object.
|
override
|
def isEmpty: Boolean
Checks if this set is empty. |
protected
|
var set: Set[A]
|
def size: Int
Returns the number of elements in this set. |
|
override
|
def toList: List[A]
Returns the elements of this set as a list. |
override
|
def toString(): String
Returns a string representation of this set. |
Methods inherited from java/lang/Object-class |
eq, finalize, getClass, notify, notifyAll, synchronized, wait, wait, wait |
Methods inherited from scala/Any-class |
!=, ==, asInstanceOf, isInstanceOf, match |
Methods inherited from scala/Iterable-class |
/:, :\, find, foldLeft, foldRight, forall, sameElements |
Methods inherited from scala/collection/Set-class |
apply, equals, subsetOf |
Methods inherited from scala/collection/mutable/Set-class |
++=, ++=, --=, --=, <<, clone, excl, filter, hashCode, incl, intersect, update |
Method Detail |
protected var set: Set[A]
def size: Int
override def isEmpty: Boolean
def contains(elem: A): Boolean
elem
.
elem
-
the element to check for membership.
elem
is contained in this set.
override def foreach(f: (A) => Unit): Unit
f
to all elements of this
iterable object.
f
-
a function that is applied to every element.
override def exists(p: (A) => Boolean): Boolean
p
to all elements of this
iterable object and return true, iff there is at least one
element for which p
yields true.
p
-
the predicate
override def toList: List[A]
override def toString(): String
def elements: Iterator[A]
def +=(elem: A): Unit
def -=(elem: A): Unit
-=
can be used to remove a single element from
a set.
def clear: Unit
protected def empty: Set[A]
|
Scala
1.2.0.1 |
|||