commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-238) [lang] Add equals(type[]) to NumberUtils
Date Wed, 30 Dec 2009 10:09:29 GMT

    [ https://issues.apache.org/jira/browse/LANG-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795273#action_12795273
] 

Henri Yandell commented on LANG-238:
------------------------------------

ArraySet would be:

{code:java}
public class ArraySet<E> extends AbstractSet<E> {

    private E[] array;

    public ArraySet(E[] array) {
        super();
        this.array = array;
        this.iterator = new ArrayIterator();
    }

    public int size() {
        return this.array.length;
    }

    public Iterator<E> iterator() {
        return new ArrayIterator(this.array);
    }   

}
{code}

Where ArrayIterator is a class from Collections. So a) not much to it at first glance and
b) very squarely an overlap with Collections. Implementing items in ArrayUtils/Arrays that
are better handled by the collections themselves is probably quite the anti-pattern.

> [lang] Add equals(type[]) to NumberUtils
> ----------------------------------------
>
>                 Key: LANG-238
>                 URL: https://issues.apache.org/jira/browse/LANG-238
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.math.*
>    Affects Versions: Nightly Builds
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Paul Benedict
>            Priority: Minor
>             Fix For: 3.0
>
>
> It would be useful to add an equals() method like the current min and max
> methods which take an array type and determine if all the values are equal.
> I have found myself in need of this often. I have to retrieve objects from
> multiple data sources in parallel to build an array of complex object. To ensure
> validity, I always compare that my sub-retrievals returned the same number of
> objects as expected.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message