You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benjamin McCann (JIRA)" <ji...@apache.org> on 2009/02/23 01:31:01 UTC
[jira] Created: (LANG-483) Add ComparisonUtils to Commons Lang
Add ComparisonUtils to Commons Lang
-----------------------------------
Key: LANG-483
URL: https://issues.apache.org/jira/browse/LANG-483
Project: Commons Lang
Issue Type: New Feature
Reporter: Benjamin McCann
Attachments: ComparisonUtils.java, ComparisonUtilsTest.java
It'd be impossible to guess how many times code as been written to find the position of the maximum element in an array or the value of the minimum element in a list, etc. This class will handle all of that.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-483) Add ComparisonUtils to Commons Lang
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-483?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Yandell updated LANG-483:
-------------------------------
Fix Version/s: (was: 3.0)
3.1
No backwards compat issues, so moving to 3.1. If resolved before 3.0 is released please assign to 3.0.
> Add ComparisonUtils to Commons Lang
> -----------------------------------
>
> Key: LANG-483
> URL: https://issues.apache.org/jira/browse/LANG-483
> Project: Commons Lang
> Issue Type: New Feature
> Components: lang.*
> Reporter: Benjamin McCann
> Fix For: 3.1
>
> Attachments: ComparisonUtils.java, ComparisonUtilsTest.java
>
>
> It'd be impossible to guess how many times code as been written to find the position of the maximum element in an array or the value of the minimum element in a list, etc. This class will handle all of that.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-483) Add ComparisonUtils to Commons Lang
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-483?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Yandell updated LANG-483:
-------------------------------
Fix Version/s: 3.0
> Add ComparisonUtils to Commons Lang
> -----------------------------------
>
> Key: LANG-483
> URL: https://issues.apache.org/jira/browse/LANG-483
> Project: Commons Lang
> Issue Type: New Feature
> Reporter: Benjamin McCann
> Fix For: 3.0
>
> Attachments: ComparisonUtils.java, ComparisonUtilsTest.java
>
>
> It'd be impossible to guess how many times code as been written to find the position of the maximum element in an array or the value of the minimum element in a list, etc. This class will handle all of that.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LANG-483) Add ComparisonUtils to Commons Lang
Posted by "Ivan Bilenjkij (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731794#action_12731794 ]
Ivan Bilenjkij commented on LANG-483:
-------------------------------------
Other than that, the scope of this class is on arrays and lists of comparable objects - quite narrow and would probably be more suited for the commons-collections. How about min(Collection<T>)? Also, the purpose and results of maximums and minimums methods are not documented properly - I really had to dig through the sources and test cases to see the point of it.
> Add ComparisonUtils to Commons Lang
> -----------------------------------
>
> Key: LANG-483
> URL: https://issues.apache.org/jira/browse/LANG-483
> Project: Commons Lang
> Issue Type: New Feature
> Reporter: Benjamin McCann
> Fix For: 3.0
>
> Attachments: ComparisonUtils.java, ComparisonUtilsTest.java
>
>
> It'd be impossible to guess how many times code as been written to find the position of the maximum element in an array or the value of the minimum element in a list, etc. This class will handle all of that.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-483) Add ComparisonUtils to Commons Lang
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-483?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin McCann updated LANG-483:
---------------------------------
Attachment: ComparisonUtilsTest.java
ComparisonUtils.java
> Add ComparisonUtils to Commons Lang
> -----------------------------------
>
> Key: LANG-483
> URL: https://issues.apache.org/jira/browse/LANG-483
> Project: Commons Lang
> Issue Type: New Feature
> Reporter: Benjamin McCann
> Attachments: ComparisonUtils.java, ComparisonUtilsTest.java
>
>
> It'd be impossible to guess how many times code as been written to find the position of the maximum element in an array or the value of the minimum element in a list, etc. This class will handle all of that.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LANG-483) Add ComparisonUtils to Commons Lang
Posted by "Benjamin McCann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12733360#action_12733360 ]
Benjamin McCann commented on LANG-483:
--------------------------------------
Another improvement would be to accept a Comparator as an optional second argument.
I wrote this quite awhile ago, and I don't have time to do the fixes anymore, so you can do whatever you want with this. If someone wants to do the cleanup and submit it, that's great. If you want to close the issue and not use it, that's fine too.
> Add ComparisonUtils to Commons Lang
> -----------------------------------
>
> Key: LANG-483
> URL: https://issues.apache.org/jira/browse/LANG-483
> Project: Commons Lang
> Issue Type: New Feature
> Reporter: Benjamin McCann
> Fix For: 3.0
>
> Attachments: ComparisonUtils.java, ComparisonUtilsTest.java
>
>
> It'd be impossible to guess how many times code as been written to find the position of the maximum element in an array or the value of the minimum element in a list, etc. This class will handle all of that.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LANG-483) Add ComparisonUtils to Commons Lang
Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839153#action_12839153 ]
Paul Benedict commented on LANG-483:
------------------------------------
I would pull most of these utility methods into their proper places like ArrayUtils. My addition would be a new enum that represents LESS(-1), EQUAL(0), GREATER(1) so that I can perform switch statements on comparison results.
> Add ComparisonUtils to Commons Lang
> -----------------------------------
>
> Key: LANG-483
> URL: https://issues.apache.org/jira/browse/LANG-483
> Project: Commons Lang
> Issue Type: New Feature
> Components: lang.*
> Reporter: Benjamin McCann
> Fix For: 3.1
>
> Attachments: ComparisonUtils.java, ComparisonUtilsTest.java
>
>
> It'd be impossible to guess how many times code as been written to find the position of the maximum element in an array or the value of the minimum element in a list, etc. This class will handle all of that.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LANG-483) Add ComparisonUtils to Commons Lang
Posted by "Ivan Bilenjkij (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731782#action_12731782 ]
Ivan Bilenjkij commented on LANG-483:
-------------------------------------
This is just from my first brief look at the ComparisonUtils class: Allow superclasses to define Comparable so use the <Y extends Comparable<? super Y>> and perhaps use T as a placeholder instead of Y as the T (from 'Type') is commonly used.
> Add ComparisonUtils to Commons Lang
> -----------------------------------
>
> Key: LANG-483
> URL: https://issues.apache.org/jira/browse/LANG-483
> Project: Commons Lang
> Issue Type: New Feature
> Reporter: Benjamin McCann
> Fix For: 3.0
>
> Attachments: ComparisonUtils.java, ComparisonUtilsTest.java
>
>
> It'd be impossible to guess how many times code as been written to find the position of the maximum element in an array or the value of the minimum element in a list, etc. This class will handle all of that.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.