commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [lang] Equalator?
Date Tue, 18 May 2004 20:40:09 GMT
See ComparatorChain in [collections]. The chain uses the second comparator
if the first returns zero (equal), it uses the third comparator if the first
and second return zero.

Stephen

----- Original Message -----
From: "Inger, Matthew" <Inger@Synygy.com>
> Not really.  It doesn't make sense to chain comparalators with
> operations like and/or.  Comparators are for comparing objects, and
> returning one of three values:
> Less Than
> Equal To
> Greater Than
>
> There's no way to logically chain these together.  Chaining only
> makes sense with boolean values (ie. two possible outcomes).
>
>
> -----Original Message-----
> From: Edelson, Justin [mailto:Justin.Edelson@mtvi.com]
> Sent: Tuesday, May 18, 2004 4:21 PM
> To: Jakarta Commons Developers List
> Subject: RE: [lang] Equalator?
>
>
> The one thing I can do with an Equalator that I don't see how to do (in
> a meaningful way) with Comparators is chain them. I've implemented a
> ChainedOrEqualator that contains a list of Equalators. If one returns
> true, then the ChainedOrEqualator returns true. Likewise, there's a
> ChainedAndEqualator.
>
> Am I missing a way to do this with Comparators?
>
> -----Original Message-----
> From: Chuck Daniels [mailto:cjd4@yahoo.com]
> Sent: Tuesday, May 11, 2004 8:55 PM
> To: Jakarta Commons Developers List
> Subject: RE: [lang] Equalator?
>
>
> I suggest you simply implement the Comparator interface since it is a
> "superset" of your suggested Equalator interface.  Therefore, I would
> implement your MetaphoneEqualator as EncodingComparator.  The class name
> prefix is changed from Metaphone to Encoding since you are not actually
> comparing Metaphones, but rather two encodings produced by a single
> Metaphone.  More generally, you are actually comparing two encodings
> produced by a single Encoder:
>
> ...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message