private ShapePoint doMap(org.onebusaway.gtfs.model.ShapePoint rhs) { ShapePoint lhs = new ShapePoint(); lhs.setShapeId(AgencyAndIdMapper.mapAgencyAndId(rhs.getShapeId())); lhs.setSequence(rhs.getSequence()); lhs.setLat(rhs.getLat()); lhs.setLon(rhs.getLon()); lhs.setDistTraveled(rhs.getDistTraveled()); // Skip mapping of proxy // private transient StopTimeProxy proxy; if (rhs.getProxy() != null) { throw new IllegalStateException("Did not expect proxy to be set! Data: " + rhs); } return lhs; } }
@Override public int compareTo(ShapePoint o) { return this.getSequence() - o.getSequence(); } }
@Override public int compareTo(ShapePoint o) { return this.getSequence() - o.getSequence(); } }
@Override public int compare(ShapePoint o1, ShapePoint o2) { int c = o1.getShapeId().compareTo(o2.getShapeId()); if (c == 0) c = o1.getSequence() - o2.getSequence(); return c; }
@Override public int compare(ShapePoint o1, ShapePoint o2) { int c = o1.getShapeId().compareTo(o2.getShapeId()); if (c == 0) c = o1.getSequence() - o2.getSequence(); return c; }
@Override public String toString() { return "<ShapePoint " + getShapeId() + " #" + getSequence() + " (" + getLat() + "," + getLon() + ")>"; }
@Override public String toString() { return "<ShapePoint " + getShapeId() + " #" + getSequence() + " (" + getLat() + "," + getLon() + ")>"; }
/**** * {@link List} Interface ****/ @Override public boolean add(ShapePoint shapePoint) { int index = size; size++; ensureCapacity(size); shapeIds[index] = shapePoint.getShapeId(); sequences[index] = shapePoint.getSequence(); lats[index] = shapePoint.getLat(); lons[index] = shapePoint.getLon(); distTraveled[index] = shapePoint.getDistTraveled(); return true; }
/**** * {@link List} Interface ****/ @Override public boolean add(ShapePoint shapePoint) { int index = size; size++; ensureCapacity(size); shapeIds[index] = shapePoint.getShapeId(); sequences[index] = shapePoint.getSequence(); lats[index] = shapePoint.getLat(); lons[index] = shapePoint.getLon(); distTraveled[index] = shapePoint.getDistTraveled(); return true; }
Collection<List<ShapePoint>> shapePointLists = mShapePoints.values(); for (List<ShapePoint> shapePointList : shapePointLists) { shapePointList.sort(Comparator.comparing(shapePoint -> (shapePoint.getSequence())));