Draft proposal: allow the use of relational operators on Comparable classes (original) (raw)
Tom Hawtin Thomas.Hawtin at Sun.COM
Wed Mar 18 05🔞09 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 ]
Olivier Chorier wrote:
I think dots are not a good solution because IDE are used to propose auto-completion with it
Then IDEs could propose one of these operators. Looks like an advantage to me.
Another potential issue with the language proposal is that compareTo is potentially somewhat less efficient than less general methods. For instance String.equals implementations can quickly determine that the argument is different through hash code and length. Computing compareTo could be much slower.
Tom Hawtin
2009/3/18 Howard Lovatt <howard.lovatt at iee.org>
You could use new operators:
.<._ _.<=._ _.>. .>=. .==. The dots are meant to remind everyone that a method, comparable, is called.
- 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 ]