Draft proposal: allow the use of relational operators on Comparable classes (original) (raw)
rssh at gradsoft.com.ua rssh at gradsoft.com.ua
Tue Mar 10 16:51:25 PDT 2009
- Previous message: Draft proposal: allow the use of relational operators on Comparable classes
- Next message: Draft proposal: allow the use of relational operators on Comparable classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message: Draft proposal: allow the use of relational operators on Comparable classes
- Next message: Draft proposal: allow the use of relational operators on Comparable classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]