date.iterator.count.util.Distance Maven / Gradle / Ivy
package date.iterator.count.util;
import java.util.HashMap;
import java.util.Map;
public class Distance {
private int[] keys;
private double value;
private final Map keyIndexes = new HashMap<>();
public Distance(int[] keys, double value) {
this.keys = keys;
this.value = value;
}
public int[] getKeys() {
return keys;
}
public double getValue() {
return value;
}
public void setKeys(final int key1, final int key2) {
keys[0] = key1;
keys[1] = key2;
}
public int getAnotherKey(final int key1) {
if (keys[0] == key1) {
return keys[1];
} else if (keys[1] == key1) {
return keys[0];
} else {
return -1;
}
}
public void setValue(double value) {
this.value = value;
}
}