ingo@427: package de.intevation.gnv.math; ingo@427: ingo@429: import java.io.Serializable; ingo@427: import java.util.ArrayList; ingo@427: import java.util.List; ingo@427: ingo@427: /** ingo@427: * @author Ingo Weinzierl ingo@427: */ ingo@429: public class XYColumn ingo@429: implements Serializable ingo@429: { ingo@427: ingo@427: private double x; ingo@427: private double y; ingo@427: ingo@427: private int i; ingo@427: private int j; ingo@427: ingo@427: private List values; ingo@427: ingo@427: public XYColumn(double x, double y, int i, int j) { ingo@427: this.x = x; ingo@427: this.y = y; ingo@427: this.i = i; ingo@427: this.j = j; ingo@427: } ingo@427: ingo@427: ingo@427: public void add(HeightValue value) { ingo@429: if (values == null) { ingo@429: values = new ArrayList(); ingo@429: } ingo@427: values.add(value); ingo@427: } ingo@427: ingo@427: ingo@427: public HeightValue[] getValues() { ingo@427: return (HeightValue[]) values.toArray(new HeightValue[values.size()]); ingo@427: } ingo@429: ingo@429: ingo@429: public int hashCode() { ingo@429: return (i << 16) | j; ingo@429: } ingo@429: ingo@429: ingo@429: public boolean equals(Object obj) { ingo@429: XYColumn other = (XYColumn) obj; ingo@429: ingo@429: return i == other.i && j == other.j && x == other.x && y == other.y; ingo@429: } ingo@427: }