Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int compareTo(Vertex v) {
- final int BEFORE = -1;
- final int AFTER = 1;
- final int EQUAL = 0;
- if (this == v) return EQUAL;
- if (this.y < v.y) {
- return BEFORE;
- } else {
- if (this.y == v.y) {
- if (this.x < v.x) {
- return BEFORE;
- } else {
- return AFTER;
- }
- } else {
- return AFTER;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement