final class ZNonEmptySet[+A, +B] extends AnyRef
Similar to ZSet
, a ZNonEmptySet[A, B]
is a guaranteed non-empty set of A
values where B
represents some notion of
"how many" A
values are included in the set. This can be the number of
times each element appears in the set if B
is a natural number, the
probability associated with an element in the set if B
is a rational
number, or even whether an element appears at all if B
is a boolean.
- Self Type
- ZNonEmptySet[A, B]
- Alphabetic
- By Inheritance
- ZNonEmptySet
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
<*>[B1 >: B, C](that: ZNonEmptySet[C, B1])(implicit ev1: Commutative[Sum[B1]], ev2: Commutative[Prod[B1]]): ZNonEmptySet[(A, C), B1]
A symbolic alias for
zip
. -
def
<>[A1 >: A, B1 >: B](that: ZSet[A1, B1])(implicit ev: Commutative[Sum[B1]]): ZNonEmptySet[A1, B1]
A symbolic alias for
combine
. -
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[A1 >: A, B1 >: B](a: A1)(implicit ev: Identity[Sum[B1]]): B1
Returns the number of times the specified element appears in the set.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
combine[A1 >: A, B1 >: B](that: ZSet[A1, B1])(implicit ev: Commutative[Sum[B1]]): ZNonEmptySet[A1, B1]
Combines this set with the specified set to produce a new set where the number of times each element appears is the sum of the number of times it appears in this set and the specified set.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(that: Any): Boolean
Returns whether this set is equal to the specified set, meaning that the same elements appear in both sets the same number of times.
Returns whether this set is equal to the specified set, meaning that the same elements appear in both sets the same number of times.
- Definition Classes
- ZNonEmptySet → AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[B1 >: B, C](f: (A) ⇒ ZNonEmptySet[C, B1])(implicit ev1: Commutative[Sum[B1]], ev2: Commutative[Prod[B1]]): ZNonEmptySet[C, B1]
Creates a new set for each element in this set and combines the resulting sets together.
Creates a new set for each element in this set and combines the resulting sets together. The number of times each element appears will be the sum of the products of the number of times it appeared in the original set and the number of times it appears in each new set.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
Returns the hash code of this set.
Returns the hash code of this set.
- Definition Classes
- ZNonEmptySet → AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
map[B1 >: B, C](f: (A) ⇒ C)(implicit ev: Commutative[Sum[B1]]): ZNonEmptySet[C, B1]
Transforms the elements in the set using the specified function.
Transforms the elements in the set using the specified function. If this results in mapping two or more elements to the same values, the number of times the new value appears in the set will be the sum of the number of times each of the old values appeared in the set.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toMap[A1 >: A]: Map[A1, B]
Converts this set to a
Map
from elements to how many times they appear in the set. -
def
toNonEmptySet[A1 >: A, B1 >: B](implicit ev1: Equal[B1], ev2: Identity[Sum[B1]]): NonEmptySet[A1]
Converts this set to a
Set
, discarding information about how many times an element appears in the set beyond whether it appears at all. -
def
toString(): String
Returns a meaningful string representation of this set.
Returns a meaningful string representation of this set.
- Definition Classes
- ZNonEmptySet → AnyRef → Any
- def toZSet: ZSet[A, B]
-
def
transform[C](f: (B) ⇒ C): ZNonEmptySet[A, C]
Transforms the representation of how many times each element appears in the set with the specified function.
-
def
union[A1 >: A, B1 >: B](that: ZSet[A1, B1])(implicit ev1: Commutative[Max[B1]], ev2: Identity[Sum[B1]]): ZNonEmptySet[A1, B1]
Combines this set with the specified set to produce a new set where the number of times each element appears is the maximum of the number of times it appears in this set and the specified set.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
zip[B1 >: B, C](that: ZNonEmptySet[C, B1])(implicit ev1: Commutative[Sum[B1]], ev2: Commutative[Prod[B1]]): ZNonEmptySet[(A, C), B1]
Combines this set with the specified set to produce their cartesian product.
-
def
zipWith[B1 >: B, C, D](that: ZNonEmptySet[C, B1])(f: (A, C) ⇒ D)(implicit ev1: Commutative[Sum[B1]], ev2: Commutative[Prod[B1]]): ZNonEmptySet[D, B1]
Combines this set with the specified set to produce their cartesian product, combining pair of elements using the specified function
f
. -
def
|[A1 >: A, B1 >: B](that: ZSet[A1, B1])(implicit ev1: Commutative[Max[B1]], ev2: Identity[Sum[B1]]): ZNonEmptySet[A1, B1]
A symbolic alias for
union
.