Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/IJKey.java @ 657:af3f56758f59
merged gnv-artifacts/0.5
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:13:53 +0200 |
parents | b624879d2902 |
children | c4156275c1e1 |
comparison
equal
deleted
inserted
replaced
590:5f5f273c8566 | 657:af3f56758f59 |
---|---|
1 package de.intevation.gnv.math; | |
2 | |
3 import java.io.Serializable; | |
4 | |
5 /** | |
6 * @author Sascha L. Teichmann <sascha.teichmann@intevation.de> | |
7 */ | |
8 public class IJKey | |
9 implements Serializable | |
10 { | |
11 public int i; | |
12 public int j; | |
13 | |
14 public IJKey() { | |
15 } | |
16 | |
17 public IJKey(int i, int j) { | |
18 this.i = i; | |
19 this.j = j; | |
20 } | |
21 | |
22 public void sort() { | |
23 if (i > j) { | |
24 int t = i; | |
25 i = j; | |
26 j = t; | |
27 } | |
28 } | |
29 | |
30 public int hashCode() { | |
31 return (i << 16) | j; | |
32 } | |
33 | |
34 public boolean equals(Object obj) { | |
35 IJKey other = (IJKey)obj; | |
36 return i == other.i && j == other.j; | |
37 } | |
38 } | |
39 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: |