Advertisement
Guest User

dvd

a guest
Nov 23rd, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. public int compareTo(Vertex v) {
  2. final int BEFORE = -1;
  3. final int AFTER = 1;
  4. final int EQUAL = 0;
  5.  
  6. if (this == v) return EQUAL;
  7.  
  8. if (this.y < v.y) {
  9. return BEFORE;
  10. } else {
  11. if (this.y == v.y) {
  12. if (this.x < v.x) {
  13. return BEFORE;
  14. } else {
  15. return AFTER;
  16. }
  17. } else {
  18. return AFTER;
  19. }
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement