|
Scala
1.2.0.1 |
|||
Set
may only be used for
accessing elements from set implementations. Two different extensions
of trait Set
in the package scala.collections.mutable
and scala.collections.immutable
provide functionality for
adding new elements to a set. The trait in the first package is implemented
by sets the are modified destructively, whereas the trait in the second
package is used by functional set implementations that rely on immutable
data structures.
Method Summary | |
def apply(elem: A): Boolean
This method allows sets to be interpreted as predicates. |
|
abstract
|
def contains(elem: A): Boolean
Checks if this set contains element elem .
|
override
|
def equals(that: Any): Boolean
Compares this set with another object and returns true, iff the other object is also a set which contains the same elements as this set. |
def isEmpty: Boolean
Checks if this set is empty. |
|
abstract
|
def size: Int
Returns the number of elements in this set. |
def subsetOf(that: Set[A]): Boolean
Checks if this set is a subset of set that .
|
|
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 |
clone, eq, finalize, getClass, hashCode, notify, notifyAll, synchronized, wait, wait, wait |
Methods inherited from scala/Any-class |
!=, ==, asInstanceOf, isInstanceOf, match |
Methods inherited from scala/Iterable-class |
/:, :\, elements, exists, find, foldLeft, foldRight, forall, foreach, sameElements |
Method Detail |
abstract def size: Int
abstract def contains(elem: A): Boolean
elem
.
elem
-
the element to check for membership.
elem
is contained in this set.
def apply(elem: A): Boolean
elem
.
elem
-
the element to check for membership.
elem
is contained in this set.
def isEmpty: Boolean
def subsetOf(that: Set[A]): Boolean
that
.
that
-
another set.
override def equals(that: Any): Boolean
that
-
the other object
def toList: List[A]
override def toString(): String
|
Scala
1.2.0.1 |
|||