Class JourneyState
java.lang.Object
rgu.transport.geospatial.multimodal.JourneyState
Represents a state of a journey, as location, time, and vehicle state.
- Author:
- Lee A. Christie
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic Predicate<JourneyState> atLocation(GeoLocation location) Creates a predicate which matches any JourneyState which is at the specified location.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.booleanbusPass()booleaninthashCode()location()Returns the location.static JourneyStateof(GeoLocation location, LocalDateTime time, boolean vehicle, boolean busPass) Returns a journey state for the given location and time.static JourneyStateof(GeoLocation location, LocalDateTime time, boolean vehicle, boolean busPass, boolean artificial) Returns a journey state for the given location and time.static JourneyStateof(GeoLocation location, LocalDateTime time, boolean vehicle, boolean busPass, boolean artificial, String hiddenMetaData) static JourneyStateof(GeoLocation location, LocalDateTime time, boolean vehicle, boolean busPass, String hiddenMetaData) static JourneyStateof(JourneyPosition position, LocalDateTime time) Returns a journey state for the given location and time.static JourneyStateof(JourneyPosition position, LocalDateTime start, Duration duration) position()Returns the position.time()Returns the time.toString()booleanvehicle()Returns whether the traveller has a vehicle.
-
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 nulltime- the time, not nullvehicle- 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 nulltime- the time, not nullvehicle- 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
Returns a journey state for the given location and time.- Parameters:
position- the journey position, not nulltime- the time, not null- Returns:
- a journey state instance
-
of
-
position
-
location
-
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() -
hashCode
-
equals
-
toString
-
atLocation
Creates a predicate which matches any JourneyState which is at the specified location.- Parameters:
location- the target location, not null- Returns:
- a predicate
-
atLocation
Creates a predicate which matches any JourneyState which is at the specified location with the specified vehicle state.- Parameters:
location- the target location, not nullvehicle- whether or not the traveller has a vehicle- Returns:
- a predicate
-