public TrainPath(TrainPath p) { length = p.length; actualLength = new PathLength(p.actualLength); ListIterator i = p.segments.listIterator(0); while (i.hasNext()) { segments.add(new IntLine((IntLine) i.next()));
public TrainPath (Point[] points) { actualLength = new PathLength(); for (int i = 1; i < points.length; i++) { if (points[i - 1].equals(points[i]) && i < points.length - 1) continue; IntLine l = new IntLine(points[i - 1], points[i]); segments.add(l); actualLength.add(l.getLength());
    public TrainPath(TrainPath p) {	length = p.length;	actualLength = new PathLength(p.actualLength);	ListIterator i = p.segments.listIterator(0);	while (i.hasNext()) {	    segments.add(new IntLine((IntLine) i.next()));	}    }