Interface RoutedTripSchedule

    • Method Detail

      • getDepartures

        RoutedTripDepartures getDepartures()
        Access to the departures of this schedule
        Returns:
        departures
      • hasDepartures

        default boolean hasDepartures()
        Verify if any departures are present on the schedule
        Returns:
        true when present, false otherwise
      • clearRelativeLegTimings

        void clearRelativeLegTimings()
        Clear all leg timings from the trip
      • clearDepartures

        void clearDepartures()
        Clear all departures from the trip
      • addRelativeLegSegmentTiming

        RelativeLegTiming addRelativeLegSegmentTiming​(ServiceLegSegment parentLegSegment,
                                                      LocalTime duration,
                                                      LocalTime dwellTime)
        Add a new leg's timing to the end of the already registered leg timings.
        Parameters:
        parentLegSegment - (directed leg) to add to the trip's route
        duration - duration of the leg segment
        dwellTime - at the destination of the leg segment
        Returns:
        the added timing
      • getRelativeLegTiming

        RelativeLegTiming getRelativeLegTiming​(int index)
        Collect a leg timing based on its index
        Parameters:
        index - to collect
        Returns:
        the relative leg timing found
      • getRelativeLegTimingsSize

        int getRelativeLegTimingsSize()
        Collect the number of registered leg timings
        Returns:
        number of relative leg timings registered
      • getLastRelativeLegTiming

        default RelativeLegTiming getLastRelativeLegTiming()
        Collect the last relative leg timing available, i.e., having the highest index
        Returns:
        found relative leg timing if any, otherwise null
      • getLastRelativeLegTimingIndex

        default int getLastRelativeLegTimingIndex()
        Get last index that is valid, when no entries exist, -1 is returned
        Returns:
        last valid index, -1 if no valid entries exist
      • getRelativeLegTimingsAsStream

        default Stream<RelativeLegTiming> getRelativeLegTimingsAsStream()
        Collect the relative leg timings as stream rather than iterable
        Returns:
        stream of relative leg timings
      • getDefaultDwellTime

        LocalTime getDefaultDwellTime()
        Get default
        Returns:
        default dwell time
      • updateDefaultDwellTimeToMostCommon

        LocalTime updateDefaultDwellTimeToMostCommon()
        Update the default dwell time to the most commonly found dwell time across all rell timings and update the relative lge timings acccordingly
        Returns:
        updated default dwell time
      • getFirstRelativeLegTiming

        default RelativeLegTiming getFirstRelativeLegTiming()
        Collect the first relative leg timing available, i.e., having the lowest index
        Returns:
        found relative leg timing if any, otherwise null
      • hasRelativeLegTimings

        default boolean hasRelativeLegTimings()
        Verify if any relative leg timing entries exist
        Returns:
        true when present, false otherwise
      • isValidRelativeLegTimingsIndex

        default boolean isValidRelativeLegTimingsIndex​(int relTimingsIndex)
        Verify if given index is a valid relative leg timings index
        Parameters:
        relTimingsIndex - to verify
        Returns:
        true when entry exists, false otherwise
      • clear

        default void clear()
        Clear the instance by removing both departures and leg timings from it. Use with caution
      • removeLegTiming

        void removeLegTiming​(int legTimingIndex)
        Remove the leg timing with the given index from the leg timings
        Parameters:
        legTimingIndex - to remove
      • removeLegTimingsIn

        default void removeLegTimingsIn​(List<Integer> legTimingIndices)
        Remove the leg timings in ascending order. Note that after removal indices might have shifted due to removal of entries
        Parameters:
        legTimingIndices - to remove, should be in ascending order
      • deepClone

        RoutedTripSchedule deepClone()
        An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
        Specified by:
        deepClone in interface IdAble
        Specified by:
        deepClone in interface RoutedTrip
        Returns:
        deep copy of entity