commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Klaus Hartlage (JIRA)" <j...@apache.org>
Subject [jira] Created: (MATH-285) FieldElement *interface* method names clash with already used method names
Date Sun, 16 Aug 2009 20:15:14 GMT
FieldElement *interface* method names clash with already used method names
--------------------------------------------------------------------------

                 Key: MATH-285
                 URL: https://issues.apache.org/jira/browse/MATH-285
             Project: Commons Math
          Issue Type: Improvement
    Affects Versions: 2.0
            Reporter: Klaus Hartlage
            Priority: Minor


This is probably to late to change, because release 2.0 is available now.

But it would be good if the FieldElement *interface* method names don't clash with already
used method names (expecially with the java.util.List#add() method) if you would like to adopt
the interface for already existing number type hierarchies.

For my hierachy I refactored the methods like this and could adopt the interface very fast.
Otherwise you have to write a lot of wrappers to adopt the FieldElement interface.

public interface FieldElement<T> {

    /** Compute this + a.
     * @param a element to add
     * @return a new element representing this + a
     */
    T plus(T a);

    /** Compute this - a.
     * @param a element to subtract
     * @return a new element representing this - a
     */
    T minus(T a);

    /** Compute this &times; a.
     * @param a element to multiply
     * @return a new element representing this &times; a
     */
    T times(T a);

    /** Compute this &divide; a.
     * @param a element to add
     * @return a new element representing this &divide; a
     * @exception ArithmeticException if a is the zero of the
     * additive operation (i.e. additive identity)
     */
    T div(T a) throws ArithmeticException;

.....
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message