A case class representing an unordered collection of elements in the form of a Set.
Type parameters
- T
-
the type of the elements contained in the set.
Value parameters
- elements
-
a set of elements of type
Tforming the basis of the adjacency set. This class extends theUnorderedtrait, providing a concrete implementation for unordered data structures. TheUnordered_Setis immutable, meaning that any operation resulting in modification (such as adding a new element) will return a new instance ofUnordered_Setwithout changing the original instance.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass AbstractUnordered[T]trait Unordered[T]class Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Checks whether the specified element is contained within the set.
Checks whether the specified element is contained within the set.
Value parameters
- u
-
the element to search for within the set. Its type must conform to or extend the type
Tof the elements in the set or be a supertype ofT.
Attributes
- Returns
-
trueif the element exists within the set, otherwisefalse.
Creates a new unordered collection containing the provided elements.
Creates a new unordered collection containing the provided elements.
This method accepts a sequence of elements, converts them into a set (ensuring uniqueness), and returns a new instance of Unordered with these elements.
Value parameters
- elements
-
a sequence of elements to be included in the new unordered collection. The type of elements must conform to or be a supertype of the existing elements in the collection.
Attributes
- Returns
-
a new
Unorderedinstance containing the specified elements.
Inherited methods
Adds the specified element to the unordered collection.
Adds the specified element to the unordered collection.
Type parameters
- U
-
a supertype of T
Value parameters
- u
-
the element to be added to the collection
Attributes
- Returns
-
a new instance of
Unorderedwith the specified element added - Inherited from:
- AbstractUnordered
Counts the elements in the collection that satisfy the given predicate.
Counts the elements in the collection that satisfy the given predicate.
This method evaluates each element in the unordered collection using the provided predicate function p. It returns the total number of elements for which the predicate evaluates to true.
Value parameters
- p
-
a predicate function that takes an element of type
Tand returns a boolean, indicating whether the element satisfies the condition
Attributes
- Returns
-
the number of elements in the collection that satisfy the predicate
- Inherited from:
- Unordered
Filters the elements of the collection using the provided predicate function.
Filters the elements of the collection using the provided predicate function.
This method returns a new collection that contains only those elements for which the predicate function p evaluates to true.
Value parameters
- p
-
a predicate function that takes an element of type
Tand returns a boolean, indicating whether the element satisfies the condition or not.
Attributes
- Returns
-
an instance of
Unordered[T]containing the elements that satisfy the predicate. - Inherited from:
- AbstractUnordered
Finds the first element in the collection that satisfies the given predicate function.
Finds the first element in the collection that satisfies the given predicate function.
This method traverses the unordered collection to identify the first element for which the provided predicate function p evaluates to true. If such an element is found, it is returned wrapped in an Option. If no such element exists, None is returned.
Value parameters
- p
-
a predicate function that takes an element of type
Tand returns a boolean, indicating whether the element satisfies the condition.
Attributes
- Returns
-
an
Optioncontaining the first element that satisfies the predicate, orNoneif no such element exists in the collection. - Inherited from:
- AbstractUnordered
Checks if the unordered collection of elements is empty.
Checks if the unordered collection of elements is empty.
Attributes
- Returns
-
trueif the collection contains no elements,falseotherwise. - Inherited from:
- AbstractUnordered
Returns an iterator over the elements in the adjacency set. NOTE that the order of the elements in the iterator is unpredictable.
Returns an iterator over the elements in the adjacency set. NOTE that the order of the elements in the iterator is unpredictable.
Attributes
- Returns
-
an
Iterator[T]over the elements of typeTcontained in the set. - Inherited from:
- AbstractUnordered
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
Retrieves the number of elements contained in this collection.
Retrieves the number of elements contained in this collection.
Attributes
- Returns
-
the total count of elements as an integer.
- Inherited from:
- AbstractUnordered