BusItineraryHalt extends AbstractBusPrimitive<BusItinerary> { public void setType(BusItineraryHaltType type) { if (type != null && type != this.type) { this.type = type; firePrimitiveChanged(); } } 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 testSetType() { assertEquals(BusItineraryHaltType.STOP_ON_DEMAND, this.halt.getType()); this.eventHandler.clear(); this.halt.setType(BusItineraryHaltType.SYSTEMATIC_STOP); assertEquals(BusItineraryHaltType.SYSTEMATIC_STOP, this.halt.getType()); this.eventHandler.assertBusChangedEvent(BusChangeEventType.ITINERARY_HALT_CHANGED, this.halt); this.eventHandler.assertNoBusShapeChangedEvent(); this.eventHandler.assertNoBusShapeAttrChangedEvent(); this.eventHandler.clear(); this.halt.setType(null); assertEquals(BusItineraryHaltType.SYSTEMATIC_STOP, this.halt.getType()); this.eventHandler.assertNoEvent(); this.eventHandler.clear(); this.halt.setType(BusItineraryHaltType.STOP_ON_DEMAND); assertEquals(BusItineraryHaltType.STOP_ON_DEMAND, this.halt.getType()); this.eventHandler.assertBusChangedEvent(BusChangeEventType.ITINERARY_HALT_CHANGED, this.halt); this.eventHandler.assertNoBusShapeChangedEvent(); this.eventHandler.assertNoBusShapeAttrChangedEvent(); }