Draft proposal: allow the use of relational operators on Comparable classes
rssh at gradsoft.com.ua
rssh at gradsoft.com.ua
Tue Mar 10 16:51:25 PDT 2009
IMHO, would have sense with addition of symbol for equality check: ('==='
?)
> I've attached a draft of a proposal to allow classes which implement the
> Comparable interface to be used as operands for the relational operators.
> So
> for example if you had two Strings, a and b, you would be able to write
>
> if (a < b) {
> ...
> }
>
> instead of
>
> if (a.compareTo(b) < 0) {
> ...
> }
>
> and you could do the same with your own classes as well.
>
> Thanks in advance for any feedback,
>
> Vil.
>
>
More information about the coin-dev
mailing list