[ 
https://issues.apache.org/jira/browse/MATH-1041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13796667#comment-13796667
 ] 

Sean Owen commented on MATH-1041:
---------------------------------

I will prepare one more patch with the naming changes and javadoc. From there 
you should feel free to edit further before you commit.

Separately, on of() vs create(), I would also note that the Pair in Apache 
Crunch, and 4 Pair classes in the JDK, have an "of()" method. It does seem more 
natural to me as well. But I'm not going to make that change in this patch.

There is an internal usage of a Pair Comparator already. It seems not such a 
big thing to simply expose that. I will attach an additional patch showing how 
it can replace the existing other Comparator, but this is of course entirely 
optional.

> Add Pair factory method, toString(), Comparator 
> ------------------------------------------------
>
>                 Key: MATH-1041
>                 URL: https://issues.apache.org/jira/browse/MATH-1041
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.2
>            Reporter: Sean Owen
>            Priority: Minor
>              Labels: comparator, pair
>         Attachments: MATH-1041_Comparator.patch, MATH-1041_Pair.patch
>
>
> I use Commons Math heavily, and have adopted its Pair class for the cases 
> where I need, well, a pair of things.
> The attached patch adds three small improvements to the Pair class:
> - toString() method
> - factory method ".create()" to avoid duplicating generic types on instance 
> creation
> - a Comparator
> Tests are included. I won't feel offended if this is rejected or modified but 
> just wanted to supply  the suggestion.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to