Code example for Vector

Methods: isEmpty, lastElement

0
				buf.append(' ');
				buf.append(Double.toString(Math.round(1000.0 * p.sumDistance / 1000.0) / 1000.0d));
			} else if (d == Dim.SPEED) {
				double deltaTime = p.sumTime;
				double deltaDist = p.sumDistance;
				if (!posHist.isEmpty()) {
					deltaTime -= posHist.lastElement().sumTime;
					deltaDist -= posHist.lastElement().sumDistance;
				} 
				double speed = 0; // km/h
				if (deltaTime != 0) {
					speed = deltaDist / deltaTime;
				} 
				buf.append(' ');
				buf.append(Double.toString(speed));
			} 
		} 
	}; 
 
	class Pos { 
		public Pos() {