All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.model.plan.SortOrder Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
package org.opentripplanner.model.plan;


/**
 * OTP sort the returned itineraries according to the request {@code arriveBy} flag. The
 * paging may override the sort order.
 */
public enum SortOrder {
    /**
     * Sort itineraries in order and break ties by:
     * 
    *
  1. Street only - Street only itineraries are sorted before itineraries with transit *
  2. Arrival time - Earliest arrival time first *
  3. Generalized cost - Lowest cost first *
  4. Number of transfers - Lowest number of transfers first *
  5. Departure time - Latest departure time first *
* This is the default for a depart-after search ({@code arriveBy=false}). */ STREET_AND_ARRIVAL_TIME, /** * Sort itineraries in order and break ties by: *
    *
  1. Street only - Street only itineraries are sorted before itineraries with transit *
  2. Departure time - Latest departure time first *
  3. Generalized cost - Lowest cost first *
  4. Number of transfers - Lowest number of transfers first *
  5. Arrival time - Earliest arrival time first *
* This is the default for an arrive-by search ({@code arriveBy=true}). */ STREET_AND_DEPARTURE_TIME; /** * The itineraries are sorted with by arrival time with the earliest arrival time first. When * paging we need to know which end of the list of itineraries we should crop. This method is * used to decide that together with the current page type (next/previous). *

* This return {@code true} for the default depart-after search, and {@code false} for an * arrive-by search. */ public boolean isSortedByArrivalTimeAcceding() { return this == STREET_AND_ARRIVAL_TIME; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy