diff options
| author | bjculkin <bjculkin@mix.wvu.edu> | 2018-02-12 22:45:04 -0500 |
|---|---|---|
| committer | bjculkin <bjculkin@mix.wvu.edu> | 2018-02-12 22:45:04 -0500 |
| commit | df94066e3af02ff02d5ab4d033a3d603f743234c (patch) | |
| tree | 168a1edaf58d386c175ffb601e9d4da8e13d31e2 /base/src/main/java/bjc/utils/funcutils/EnumUtils.java | |
| parent | ae51c587c53f7ca311e556e3cbd0c5566d6c2843 (diff) | |
Formatting pass
Diffstat (limited to 'base/src/main/java/bjc/utils/funcutils/EnumUtils.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/funcutils/EnumUtils.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/base/src/main/java/bjc/utils/funcutils/EnumUtils.java b/base/src/main/java/bjc/utils/funcutils/EnumUtils.java index 2039b97..20c5972 100644 --- a/base/src/main/java/bjc/utils/funcutils/EnumUtils.java +++ b/base/src/main/java/bjc/utils/funcutils/EnumUtils.java @@ -16,19 +16,19 @@ public class EnumUtils { * Do an action for a random number of enum values. * * @param <E> - * The type of the enum. + * The type of the enum. * * @param clasz - * The enum class. + * The enum class. * * @param nValues - * The number of values to execute the action on. + * The number of values to execute the action on. * * @param action - * The action to perform on random values. + * The action to perform on random values. * * @param rnd - * The source of randomness to use. + * The source of randomness to use. */ public static <E extends Enum<E>> void doForValues(final Class<E> clasz, final int nValues, final Consumer<E> action, final Random rnd) { @@ -38,7 +38,7 @@ public class EnumUtils { final int randomValueCount = enumValues.length - nValues; - for (int i = 0; i <= randomValueCount; i++) { + for(int i = 0; i <= randomValueCount; i++) { final E rDir = valueList.randItem(rnd::nextInt); valueList.removeMatching(rDir); @@ -51,16 +51,15 @@ public class EnumUtils { * Get a random value from an enum. * * @param <E> - * The type of the enum. + * The type of the enum. * * @param clasz - * The class of the enum. + * The class of the enum. * * @param rnd - * The random source to use. + * The random source to use. * - * @return - * A random value from the specified enum. + * @return A random value from the specified enum. */ public static <E extends Enum<E>> E getRandomValue(final Class<E> clasz, final Random rnd) { final E[] enumValues = clasz.getEnumConstants(); |
