Class DiscreteSet<E>
java.lang.Object
org.episteme.core.mathematics.structures.sets.DiscreteSet<E>
-
Constructor Summary
ConstructorsConstructorDescriptionDiscreteSet(E element) Constructs a set containing a single element.DiscreteSet(Set<E> elements) Constructs a set containing the specified elements. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests whether this set contains the specified element.Returns a human-readable description of this set.booleanReturns an unmodifiable view of the elements in this set.inthashCode()booleanisEmpty()Returnstrueif this set contains no elements.iterator()Returns an iterator over the elements in this set.longsize()Returns the number of elements in this set (its cardinality).toString()Methods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
DiscreteSet
-
DiscreteSet
Constructs a set containing a single element.- Parameters:
element- the element
-
-
Method Details
-
getElements
-
size
-
contains
Description copied from interface:SetTests whether this set contains the specified element.This is the fundamental operation of a set - membership testing.
-
isEmpty
-
iterator
-
description
Description copied from interface:SetReturns a human-readable description of this set.Examples:
- "â„ (Real Numbers)"
- "ℤ/12ℤ (Integers modulo 12)"
- "{1, 2, 3, 4, 5}"
- Specified by:
descriptionin interfaceSet<E>- Returns:
- a description of this set
-
toString
-
equals
-
hashCode
-