@Test public void testCompareToV() { long id = 123; int version = 1; long timestamp = 310172400000l; long changeset = 4444; int userId = 23; int[] tags = new int[] {1, 1, 2, 2, 3, 3}; long longitude = 86809727l; long latitude = 494094984l; OSMNode a = new OSMNode(id, version, new OSHDBTimestamp(timestamp), changeset, userId, tags, longitude, latitude); OSMNode b; b = new OSMNode(id, version + 2, new OSHDBTimestamp(timestamp), changeset, userId, tags, longitude, latitude); assertTrue(a.compareTo(b) < 0); }
@Override public int compareTo(OSMNode o) { int c = Long.compare(id, o.id); if (c == 0) { c = Integer.compare(Math.abs(version), Math.abs(o.version)); } if (c == 0) { c = Long.compare(timestamp.getRawUnixTimestamp(), o.timestamp.getRawUnixTimestamp()); } return c; }
OSMNode extends OSMEntity implements Comparable<OSMNode>, Serializable { @Override public int compareTo(OSMNode o) { int c = Long.compare(id, o.id); if (c == 0) { c = Integer.compare(Math.abs(version), Math.abs(o.version)); } if (c == 0) { c = Long.compare(timestamp.getRawUnixTimestamp(), o.timestamp.getRawUnixTimestamp()); } return c; } }
OSMNode extends OSMEntity implements Comparable<OSMNode>, Serializable { @Override public int compareTo(OSMNode o) { int c = Long.compare(id, o.id); if (c == 0) { c = Integer.compare(Math.abs(version), Math.abs(o.version)); } if (c == 0) { c = Long.compare(timestamp.getRawUnixTimestamp(), o.timestamp.getRawUnixTimestamp()); } return c; } OSMNode(final long id, final int version, final OSHDBTimestamp timestamp, final long changeset,
      final int userId, final int[] tags, final long longitude, final long latitude); }
OSMNode extends OSMEntity implements Comparable<OSMNode>, Serializable { @Override public int compareTo(OSMNode o) { int c = Long.compare(id, o.id); if (c == 0) { c = Integer.compare(Math.abs(version), Math.abs(o.version)); } if (c == 0) { c = Long.compare(timestamp.getRawUnixTimestamp(), o.timestamp.getRawUnixTimestamp()); } return c; } OSMNode(final long id, final int version, final OSHDBTimestamp timestamp, final long changeset,
      final int userId, final int[] tags, final long longitude, final long latitude); @Override OSMType getType(); double getLongitude(); double getLatitude(); long getLon(); long getLat(); @Override String toString(); boolean equalsTo(OSMNode o); @Override int compareTo(OSMNode o); }
OSMNode extends OSMEntity implements Comparable<OSMNode>, Serializable { @Override public int compareTo(OSMNode o) { int c = Long.compare(id, o.id); if (c == 0) { c = Integer.compare(Math.abs(version), Math.abs(o.version)); } if (c == 0) { c = Long.compare(timestamp.getRawUnixTimestamp(), o.timestamp.getRawUnixTimestamp()); } return c; } OSMNode(final long id, final int version, final OSHDBTimestamp timestamp, final long changeset,
      final int userId, final int[] tags, final long longitude, final long latitude); @Override OSMType getType(); double getLongitude(); double getLatitude(); long getLon(); long getLat(); @Override String toString(); boolean equalsTo(OSMNode o); @Override int compareTo(OSMNode o);  }