/*
 * Java Genetic Algorithm Library (@__identifier__@).
 * Copyright (c) @__year__@ Franz Wilhelmstötter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author:
 *    Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at)
 */
package org.jenetics;

import static java.util.Objects.requireNonNull;

import java.util.function.Predicate;
import java.util.function.Supplier;

import org.jenetics.util.ISeq;

/**
 * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 * @version !__version__!
 * @since !__version__!
 */
public class AnyChromosome<A> extends AbstractChromosome<AnyGene<A>> {

	private final Supplier<? extends A> _supplier;
	private final Predicate<? super A> _validator;

	protected AnyChromosome(
		final ISeq<AnyGene<A>> genes,
		final Supplier<? extends A> supplier,
		final Predicate<? super A> validator
	) {
		super(genes);
		_supplier = requireNonNull(supplier);
		_validator = requireNonNull(validator);
	}

	@Override
	public Chromosome<AnyGene<A>> newInstance(
		final ISeq<AnyGene<A>> genes
	) {
		return new AnyChromosome<>(genes, _supplier, _validator);
	}

	@Override
	public Chromosome<AnyGene<A>> newInstance() {
		return of(_supplier, _validator, length());
	}

	public static <A> AnyChromosome<A> of(
		final Supplier<? extends A> supplier,
		final Predicate<? super A> validator,
		final int length
	) {
		return new AnyChromosome<A>(
			AnyGene.seq(length, supplier, validator),
			supplier,
			validator
		);
	}

	public static <A> AnyChromosome<A> of(
		final Supplier<? extends A> supplier,
		final int length
	) {
		return new AnyChromosome<A>(
			AnyGene.seq(length, supplier, a -> true),
			supplier,
			a -> true
		);
	}

}

@@ -916,16 +916,153 @@
 q;%0A%0A/**%0A
+ * %7B@code Chromosome%7D implementation, which allows to create genes without%0A * explicit implementing the %7B@code Chromosome%7D interface.%0A *%0A
  * @auth
@@ -1869,262 +1869,1751 @@
 %09%7D%0A%0A
-%09public static %3CA%3E AnyChromosome%3CA%3E of(%0A%09%09final Supplier%3C? extends A%3E supplier,%0A%09%09final Predicate%3C? super A%3E validator,%0A%09%09final int length%0A%09) %7B%0A%09%09return new AnyChromosome%3CA%3E(%0A%09%09%09AnyGene.seq(length, supplier, validator),%0A%09%09%09supplier,%0A%09%09%09validator%0A%09%09);%0A%09%7D%0A
+%0A%09/* *************************************************************************%0A%09 *  Static factory methods.%0A%09 * ************************************************************************/%0A%0A%09/**%0A%09 * Create a new chromosome of type %7B@code A%7D with the given parameters.%0A%09 *%0A%09 * @param %3CA%3E the allele type%0A%09 * @param supplier the allele-supplier which is used for creating new,%0A%09 *        random alleles%0A%09 * @param validator the validator used for validating the created gene. This%0A%09 *        predicate is used in the %7B@link #isValid()%7D method.%0A%09 * @param length the length of the created chromosome%0A%09 * @return a new chromosome of allele type %7B@code A%7D%0A%09 * @throws NullPointerException if the %7B@code supplier%7D or %7B@code validator%7D%0A%09 *         is %7B@code null%7D%0A%09 * @throws IllegalArgumentException if the length of the gene array is%0A%09 *         smaller than one.%0A%09 */%0A%09public static %3CA%3E AnyChromosome%3CA%3E of(%0A%09%09final Supplier%3C? extends A%3E supplier,%0A%09%09final Predicate%3C? super A%3E validator,%0A%09%09final int length%0A%09) %7B%0A%09%09return new AnyChromosome%3CA%3E(%0A%09%09%09AnyGene.seq(length, supplier, validator),%0A%09%09%09supplier,%0A%09%09%09validator%0A%09%09);%0A%09%7D%0A%0A%09/**%0A%09 * Create a new chromosome of type %7B@code A%7D with the given parameters. The%0A%09 * %7B@code validator%7D predicate of the generated gene will always return%0A%09 * %7B@code true%7D.%0A%09 *%0A%09 * @param %3CA%3E the allele type%0A%09 * @param supplier the allele-supplier which is used for creating new,%0A%09 *        random alleles%0A%09 * @param length the length of the created chromosome%0A%09 * @return a new chromosome of allele type %7B@code A%7D%0A%09 * @throws NullPointerException if the %7B@code supplier%7D or %7B@code validator%7D%0A%09 *         is %7B@code null%7D%0A%09 * @throws IllegalArgumentException if the length of the gene array is%0A%09 *         smaller than one.%0A%09 */
 %0A%09pu

Add javadoc for 'AnyChromosome'.