Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1041

Add Pair factory method, toString(), Comparator

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3
    • Labels:

      Description

      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.

        Attachments

        1. MATH-1041_Comparator.patch
          8 kB
          Sean Owen
        2. MATH-1041_MathArrays.patch
          1 kB
          Sean Owen
        3. MATH-1041_Pair.patch
          2 kB
          Sean Owen

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              srowen Sean Owen
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: