Class JourneyState

java.lang.Object
rgu.transport.geospatial.multimodal.JourneyState

public final class JourneyState extends Object
Represents a state of a journey, as location, time, and vehicle state.
Author:
Lee A. Christie
  • Method Details

    • of

      public static JourneyState of(GeoLocation location, LocalDateTime time, boolean vehicle, boolean busPass)
      Returns a journey state for the given location and time.
      Parameters:
      location - the location, not null
      time - the time, not null
      vehicle - whether the traveller has a vehicle
      Returns:
      a journey state instance
    • of

      public static JourneyState of(GeoLocation location, LocalDateTime time, boolean vehicle, boolean busPass, String hiddenMetaData)
    • of

      public static JourneyState of(GeoLocation location, LocalDateTime time, boolean vehicle, boolean busPass, boolean artificial)
      Returns a journey state for the given location and time.
      Parameters:
      location - the location, not null
      time - the time, not null
      vehicle - whether the traveller has a vehicle
      Returns:
      a journey state instance
    • of

      public static JourneyState of(GeoLocation location, LocalDateTime time, boolean vehicle, boolean busPass, boolean artificial, String hiddenMetaData)
    • of

      public static JourneyState of(JourneyPosition position, LocalDateTime time)
      Returns a journey state for the given location and time.
      Parameters:
      position - the journey position, not null
      time - the time, not null
      Returns:
      a journey state instance
    • of

      public static JourneyState of(JourneyPosition position, LocalDateTime start, Duration duration)
    • position

      public JourneyPosition position()
      Returns the position.
      Returns:
      the position
    • location

      public GeoLocation location()
      Returns the location.
      Returns:
      the location
    • time

      public LocalDateTime time()
      Returns the time.
      Returns:
      the time
    • vehicle

      public boolean vehicle()
      Returns whether the traveller has a vehicle.
      Returns:
      whether the traveller has a vehicle
    • busPass

      public boolean busPass()
    • artificial

      public boolean artificial()
    • hiddenMetadata

      public String hiddenMetadata()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Parameters:
      o -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
    • atLocation

      public static Predicate<JourneyState> atLocation(GeoLocation location)
      Creates a predicate which matches any JourneyState which is at the specified location.
      Parameters:
      location - the target location, not null
      Returns:
      a predicate
    • atLocation

      public static Predicate<JourneyState> atLocation(GeoLocation location, boolean vehicle)
      Creates a predicate which matches any JourneyState which is at the specified location with the specified vehicle state.
      Parameters:
      location - the target location, not null
      vehicle - whether or not the traveller has a vehicle
      Returns:
      a predicate