    001    /*
    002     * Licensed to the Apache Software Foundation (ASF) under one or more
    003     * contributor license agreements.  See the NOTICE file distributed with
    004     * this work for additional information regarding copyright ownership.
    005     * The ASF licenses this file to You under the Apache License, Version 2.0
    006     * (the "License"); you may not use this file except in compliance with
    007     * the License.  You may obtain a copy of the License at
    008     *
    009     *      http://www.apache.org/licenses/LICENSE-2.0
    010     *
    011     * Unless required by applicable law or agreed to in writing, software
    012     * distributed under the License is distributed on an "AS IS" BASIS,
    013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014     * See the License for the specific language governing permissions and
    015     * limitations under the License.
    016     */
    017    package org.apache.commons.math3;
    018
    019    /**
    020     * Interface representing a <a href="http://mathworld.wolfram.com/Field.html">field</a>.
    021     * <p>
    022     * Classes implementing this interface will often be singletons.
    023     * </p>
    024     * @param <T> the type of the field elements
    025     * @see FieldElement
    026     * @version $Id: Field.java 1416643 2012-12-03 19:37:14Z tn $
    027     * @since 2.0
    028     */
    029    public interface Field<T> {
    030
    031        /** Get the additive identity of the field.
    032         * <p>
    033         * The additive identity is the element e<sub>0</sub> of the field such that
    034         * for all elements a of the field, the equalities a + e<sub>0</sub> =
    035         * e<sub>0</sub> + a = a hold.
    036         * </p>
    037         * @return additive identity of the field
    038         */
    039        T getZero();
    040
    041        /** Get the multiplicative identity of the field.
    042         * <p>
    043         * The multiplicative identity is the element e<sub>1</sub> of the field such that
    044         * for all elements a of the field, the equalities a &times; e<sub>1</sub> =
    045         * e<sub>1</sub> &times; a = a hold.
    046         * </p>
    047         * @return multiplicative identity of the field
    048         */
    049        T getOne();
    050
    051        /**
    052         * Returns the runtime class of the FieldElement.
    053         *
    054         * @return The {@code Class} object that represents the runtime
    055         *         class of this object.
    056         */
    057        Class<? extends FieldElement<T>> getRuntimeClass();
    058
    059    }