Package io.keikai.doc.collab.lib0
Class Sets
java.lang.Object
io.keikai.doc.collab.lib0.Sets
Set Utility
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Set<T>create()Creates a new HashSet instance.static <T> TReturns the first element in the Set, or null if the Set is empty.static <T> Set<T>Creates a Set from an Iterable.static <T> T[]Converts a Set into a List.static <T> List<T>Converts a Set into a List.
-
Method Details
-
create
Creates a new HashSet instance.- Returns:
- A new HashSet instance.
-
toList
Converts a Set into a List.- Type Parameters:
T- The type of elements in the Set.- Parameters:
set- The Set to convert.- Returns:
- A List containing all elements in the Set.
-
toArray
Converts a Set into a List.- Type Parameters:
T- The type of elements in the Set.- Parameters:
set- The Set to convert.- Returns:
- A List containing all elements in the Set.
-
first
Returns the first element in the Set, or null if the Set is empty.- Type Parameters:
T- The type of elements in the Set.- Parameters:
set- The Set to retrieve the first element from.- Returns:
- The first element in the Set, or null if the Set is empty.
-
from
Creates a Set from an Iterable.- Type Parameters:
T- The type of elements in the Iterable.- Parameters:
entries- The Iterable of entries to add to the Set.- Returns:
- A Set containing all elements in the Iterable.
-