public class Point extends Geometry {
+ public static final boolean CUTINTS=true;
+
public int hashCode() {
return super.hashCode() ^ hashCode(x) ^ hashCode(y) ^ hashCode(z) ^ hashCode(m);
}
public void innerWKT(StringBuffer sb) {
sb.append(x);
+ if (CUTINTS) cutint(sb);
sb.append(' ');
sb.append(y);
+ if (CUTINTS) cutint(sb);
if (dimension == 3) {
sb.append(' ');
sb.append(z);
+ if (CUTINTS) cutint(sb);
}
if (haveMeasure) {
sb.append(' ');
sb.append(m);
+ if (CUTINTS) cutint(sb);
+ }
+ }
+
+ private static void cutint(StringBuffer sb) {
+ int l = sb.length()-2;
+ if ((sb.charAt(l+1)=='0')&&(sb.charAt(l)=='.')) {
+ sb.setLength(l);
}
}
}
protected int getInt(int index) {
- int hg = data.get(index + 3);
- int high = ((int) hg << 24);
- int hmed = ((int) data.get(index + 2) << 16);
- int lmed = ((int) data.get(index + 1) << 8);
- int low = (int) data.get(index);
- return high + hmed + lmed + low;
+ return (data.get(index + 3) << 24) + (data.get(index + 2) << 16) + (data.get(index + 1) << 8) + data.get(index);
}
protected long getLong(int index) {
- Possibly relicensing under LGPL
+- Possibly adding server side code to support plJava
+ http://gborg.postgresql.org/project/pljava/projdisplay.php
+