You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Stephen Kestle (JIRA)" <ji...@apache.org> on 2008/04/02 09:58:24 UTC

[jira] Resolved: (COLLECTIONS-242) Add Equator interface for more powerful collections

     [ https://issues.apache.org/jira/browse/COLLECTIONS-242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Kestle resolved COLLECTIONS-242.
----------------------------------------

    Resolution: Fixed

Added Equator interface into functors package

> Add Equator interface for more powerful collections
> ---------------------------------------------------
>
>                 Key: COLLECTIONS-242
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-242
>             Project: Commons Collections
>          Issue Type: Improvement
>          Components: Comparator
>            Reporter: Stephen Kestle
>            Assignee: Stephen Kestle
>             Fix For: Generics
>
>
> Java has Comparable and Comparator to compare objects, and objects have an equals() method. But there is no interface  for when an object has multiple ways of being equal.
> e.g.: an database object that has a name, code and a value. Equality could be based on:
> * database id
> * code
> * name and code
> * case-insensitive name
> When extended to collections, this allows us to search for specific
> values (with an EqualsPredicate that takes an Equator), and implement
> Maps and Sets that use specific equators to determine uniqueness.
> I propose that it has two methods:
> boolean equate();
> int hash();
> I shall upload some files when I next get some time.
> NB: This ticket is a summary of the email conversation begun on 5 Jan 2007: "equator interface" (http://archives.devshed.com/forums/java-118/equator-interface-2126195.html).  Stephen C made reference there to creating a FlexiMap, but in my mind, that's additional to this issue (this interface still needs to be created to be able to stand alone).

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