class BusItineraryHalt extends AbstractBusPrimitive<BusItinerary> {

	@Pure
	public boolean isEndingBusHalt() {
		final BusItinerary itinerary = getContainer();
		if (itinerary != null && itinerary.isValidPrimitive()) {
			final int count = itinerary.getValidBusHaltCount();
			if (count > 0) {
				try {
					return itinerary.getBusHaltAt(count - 1) == this;
				} catch (IndexOutOfBoundsException exception) {
					// invalid halt
				}
			}
		}
		return false;
	}

	  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);

}