You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Carlos Chavez <ca...@gmail.com> on 2006/03/20 22:28:22 UTC
Using Predicate
Hello people,
I have a collection where each items is a array of object( object[] ),
I want to use UniquePredicate to filter each item based on two items in the
array (object[])
But, i can't figure out how the UniquePredicate work. the docs says:
Evaluates the predicate returning true if the input object hasn't been
received yet.
I want to extend this for my object[], but i don't know at wich moment this
predicate indicate that the element exist in the collection.
any help are welcome.
Cheers.
--
Carlos Chávez
Re: Using Predicate
Posted by Stephen Colebourne <sc...@btopenworld.com>.
Your problems may be due to the fact that two arrays with the same
contents are not equal (the equals() method doesn't return true). This
is a historic oddity in Java.
If you change each of your collection elements to be a List instead of
an array I expect that the predicate would work.
Stephen
Carlos Chavez wrote:
> Hello people,
>
> I have a collection where each items is a array of object( object[] ),
> I want to use UniquePredicate to filter each item based on two items in the
> array (object[])
>
> But, i can't figure out how the UniquePredicate work. the docs says:
> Evaluates the predicate returning true if the input object hasn't been
> received yet.
> I want to extend this for my object[], but i don't know at wich moment this
> predicate indicate that the element exist in the collection.
>
> any help are welcome.
>
> Cheers.
> --
> Carlos Chávez
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org