You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Luc Maisonobe (JIRA)" <ji...@apache.org> on 2009/12/27 18:38:29 UTC
[jira] Resolved: (MATH-285) FieldElement *interface* method names
clash with already used method names
[ https://issues.apache.org/jira/browse/MATH-285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Luc Maisonobe resolved MATH-285.
--------------------------------
Resolution: Won't Fix
Changing this would introduce a major incompatibility since it would change method names for already widely used classes like Complex and Fraction.
> 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 × a.
> * @param a element to multiply
> * @return a new element representing this × a
> */
> T times(T a);
> /** Compute this ÷ a.
> * @param a element to add
> * @return a new element representing this ÷ 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.