Tag Archives: spaceship
Groovy language, spaceship operator
August 28, 2013Posted by on
x <=> y
Useful in comparisons:
- returns -1 if x is smaller than y
- return 0 if x equals to y
- returns 1 if x is greater than y.
Isn’t it sweet?