commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joerg Schaible (JIRA)" <>
Subject [jira] [Commented] (MATH-1041) Add Pair factory method, toString(), Comparator
Date Wed, 16 Oct 2013 09:39:46 GMT


Joerg Schaible commented on MATH-1041:

@Gilles: Please reconsider the name of the factory method. Pair of Commons Lang has Pair.of(K,V).
IIRC Pair of Math started as copy to avoid the dependency, but it gets strange if different
method names are used to do the same.

> Add Pair factory method, toString(), Comparator 
> ------------------------------------------------
>                 Key: MATH-1041
>                 URL:
>             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

View raw message