summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/funcutils/SetUtils.java
diff options
context:
space:
mode:
authorBenjamin J. Culkin <bjculkin@mix.wvu.edu>2021-07-12 15:53:22 -0300
committerBenjamin J. Culkin <bjculkin@mix.wvu.edu>2021-07-12 15:53:22 -0300
commita24c1042499f76ff2d442ae133ef165011a7af4c (patch)
tree1a0bdff895b7dc2bd9e8006fe3b83805c7e56f4f /base/src/main/java/bjc/utils/funcutils/SetUtils.java
parente55cb9852a106cff26517d7d1e85bc4b149884f3 (diff)
Formatting tweaks
Diffstat (limited to 'base/src/main/java/bjc/utils/funcutils/SetUtils.java')
-rw-r--r--base/src/main/java/bjc/utils/funcutils/SetUtils.java33
1 files changed, 14 insertions, 19 deletions
diff --git a/base/src/main/java/bjc/utils/funcutils/SetUtils.java b/base/src/main/java/bjc/utils/funcutils/SetUtils.java
index babdb8e..799eadc 100644
--- a/base/src/main/java/bjc/utils/funcutils/SetUtils.java
+++ b/base/src/main/java/bjc/utils/funcutils/SetUtils.java
@@ -5,20 +5,17 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-/**
- * Various utility functions dealing with sets.
+/** Various utility functions dealing with sets.
*
- * @author bjculkin
- *
- */
+ * @author bjculkin */
public class SetUtils {
- /**
- * Create a power-set (set of all subsets) of a given set.
+ /** Create a power-set (set of all subsets) of a given set.
*
- * @param originalSet
- * The set to create a power-set of.
- * @return The power-set of the set.
- */
+ * @param <T> The type of element in the set.
+ *
+ * @param originalSet The set to create a power-set of.
+ *
+ * @return The power-set of the set. */
public static <T> Set<Set<T>> powerSet(Set<T> originalSet) {
Set<Set<T>> sets = new HashSet<>();
@@ -52,19 +49,17 @@ public class SetUtils {
return sets;
}
- /**
- * Utility method for set construction.
+ /** Utility method for set construction.
*
- * @param elms
- * The elements to stick in the set.
- * @return A set containing the specified elements.
- */
+ * @param <T> The type of element in the set.
+ *
+ * @param elms The elements to stick in the set.
+ *
+ * @return A set containing the specified elements. */
@SafeVarargs
public static <T> Set<T> toSet(T... elms) {
Set<T> set = new HashSet<>();
-
for (T elm : elms) set.add(elm);
-
return set;
}
}