BusItineraryHalt extends AbstractBusPrimitive<BusItinerary> { @Pure public double getPositionOnSegment() { return this.curvilineDistance; } BusItineraryHalt(BusItinerary itinerary, String name, BusItineraryHaltType type);   BusItineraryHalt(UUID id, BusItinerary itinerary, String name, BusItineraryHaltType type);   BusItineraryHalt(BusItinerary itinerary, String name, BusItineraryHaltType type, AttributeCollection attributeProvider);   BusItineraryHalt(UUID id, BusItinerary itinerary, String name, BusItineraryHaltType type,
			AttributeCollection attributeProvider); @Override @Pure void toJson(JsonBuffer buffer); @Pure static String getFirstFreeBushaltName(BusItinerary busItinerary); @Override void rebuild(boolean fireEvents); @Pure int getInvalidListIndex(); @Override @Pure BusNetwork getBusNetwork(); @Pure BusStop getBusStop(); boolean setBusStop(BusStop busStop); @Override void setName(String name); @Pure Point2d getPosition2D(); @Pure Point1d getPosition1D(); @Pure RoadSegment getRoadSegment(); @Pure int getRoadSegmentIndex(); @Pure double getPositionOnSegment(); @Pure Direction1D getRoadSegmentDirection(); @Pure BusItineraryHaltType getType(); void setType(BusItineraryHaltType type); @Pure boolean isTerminus(); @Override @Pure int indexInParent(); @Pure boolean isStartingBusHalt(); @Pure boolean isEndingBusHalt(); @Pure boolean insideBusHub(); @Pure Iterable<BusHub> busHubs(); @Pure Iterator<BusHub> busHubIterator(); @Override Shape2d<?> getShape(); @Override @Pure final GeoLocation getGeoLocation(); @Pure GeoLocationPoint getGeoPosition(); @Pure double distanceToBusStop(); @Pure double distance(double x, double y); @Pure double distance(Point2D<?, ?> point); @Pure double distance(BusItineraryHalt halt); @Pure double distance(BusStop busStop); @Pure double distance(GeoLocationPoint point); static final double DISTANCE_BETWEEN_HALT_AND_ROAD_BORDER; }
@Test public void testGetPositionOnSegment() { assertTrue(Double.isNaN(this.halt.getPositionOnSegment())); this.halt.setPositionOnSegment(4f); assertEpsilonEquals(4f, this.halt.getPositionOnSegment()); this.itinerary.addRoadSegment(this.segment2); this.itinerary.addRoadSegment(this.segment1); assertEpsilonEquals(4f, this.halt.getPositionOnSegment()); this.halt.setPositionOnSegment(6f); assertEpsilonEquals(6f, this.halt.getPositionOnSegment()); this.halt.setPositionOnSegment(Float.NaN); assertTrue(Double.isNaN(this.halt.getPositionOnSegment())); }