package aalg.algebra;

import java.math.BigInteger;

/**
 * Definition of the subgroup.
 * @author Ing. Petr Ležák
 *
 * @param <T> type of the element
 */
public class SubGroupDefinition<T extends IElement> {
	
	private final IGroup<T> group;   // Main group
	private final T generator;   // Subgroup generator
	private final BigInteger order;   // Order (number of elements) of the subgroup
	
	/**
	 * Creates subgroup definition.
	 * @param group main group
	 * @param generator subgroup generator
	 * @param order order (number of elements) of the subgroup
	 */
	public SubGroupDefinition (final IGroup<T> group, final T generator, final BigInteger order) {
		this.group = group;
		this.generator = generator;
		this.order = order;
	}

	/**
	 * Returns main group.
	 * @return main group
	 */
	public IGroup<T> getGroup() {
		return group;
	}

	/**
	 * Returns subgroup generator.
	 * @return subgroup generator
	 */
	public T getGenerator() {
		return generator;
	}

	/**
	 * Returns order of the subgroup.
	 * @return order of the subgroup
	 */
	public BigInteger getOrder() {
		return order;
	}
}
