diff --git a/src/main/java/org/paukov/combinatorics3/Generator.java b/src/main/java/org/paukov/combinatorics3/Generator.java index 52894d9..bbabcf1 100644 --- a/src/main/java/org/paukov/combinatorics3/Generator.java +++ b/src/main/java/org/paukov/combinatorics3/Generator.java @@ -15,28 +15,64 @@ */ public class Generator { + /** + * Creates a combination generator for a given set of arguments. + * @param args A list of arguments (elements) for the generator. + * @param A type of the arguments. + * @return An instance of the CombinationGenerator with the provided elements. + */ @SafeVarargs public static CombinationGenerator combination(T... args) { return new CombinationGenerator<>(asList(args)); } + /** + * Creates a combination generator for a given set of arguments. + * @param collection A collection of the elements for the generator. + * @param A type of the elements. + * @return An instance of the CombinationGenerator with the provided elements. + */ public static CombinationGenerator combination(Collection collection) { return new CombinationGenerator<>(collection); } + /** + * Creates a permutation generator for a given set of arguments. + * @param args A list of arguments (elements) for the generator. + * @param A type of the arguments. + * @return An instance of the PermutationGenerator with the provided elements. + */ @SafeVarargs public static PermutationGenerator permutation(T... args) { return new PermutationGenerator<>(asList(args)); } + /** + * Creates a permutation generator for a given collection of the elements. + * @param collection A collection of the elements for the generator. + * @param A type of the elements. + * @return An instance of the PermutationGenerator with the provided elements. + */ public static PermutationGenerator permutation(Collection collection) { return new PermutationGenerator<>(collection); } + /** + * Creates a subset generator for a given collection of the elements. + * @param collection A collection of the elements for the generator. + * @param A type of the elements. + * @return An instance of the generator that produces subsets of the elements. + */ public static SubSetGenerator subset(Collection collection) { return new SubSetGenerator<>(collection); } + /** + * Creates a subset generator for a given list of the arguments. + * @param args A list of the arguments for the generator. + * @param A type of the elements. + * @return An instance of the generator that produces subsets of the elements. + */ @SafeVarargs public static SubSetGenerator subset(T... args) { return new SubSetGenerator<>(asList(args)); diff --git a/src/main/java/org/paukov/combinatorics3/SubSetGenerator.java b/src/main/java/org/paukov/combinatorics3/SubSetGenerator.java index ef6aab8..36ca5bf 100644 --- a/src/main/java/org/paukov/combinatorics3/SubSetGenerator.java +++ b/src/main/java/org/paukov/combinatorics3/SubSetGenerator.java @@ -9,7 +9,7 @@ /** * A generator for iterating over the subsets. - * @param Type of the elements in the sebsets. + * @param Type of the elements in the subsets. */ public class SubSetGenerator {