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

Add Pair factory method, toString(), Comparator

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2
    • 3.3
    • None

    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 R. Owen
        2. MATH-1041_MathArrays.patch
          1 kB
          Sean R. Owen
        3. MATH-1041_Pair.patch
          2 kB
          Sean R. Owen

        Activity

          People

            Unassigned Unassigned
            srowen Sean R. Owen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: