length += tp.getLength();
actualLength.add(tp.actualLength); length = (int) actualLength.getLength();
    public void append(TrainPath tp) {	IntLine tpHead = (IntLine) tp.segments.getFirst();	IntLine tail = (IntLine) segments.getLast();	if (tpHead.x2 != tail.x1 ||		tpHead.y2 != tail.y1)	    throw new IllegalArgumentException();	if (tpHead.getDirection() == tail.getDirection()) {	    tail.append(tpHead);	} else {	    segments.add(tpHead);	}	ListIterator i = tp.segments.listIterator(1);	while (i.hasNext()) {	    segments.add(i.next());	}	length += tp.getLength();    }