Class RoadEdge
java.lang.Object
rgu.transport.geospatial.osm.RoadEdge
- Author:
- Lee A. Christie
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Predicate<Graph.Edge<GeoLocation, RoadEdge>> containsBothEndPoints(Predicate<GeoLocation> filter) A predicate which is true if both end points of a graph edge match the given predicate.static Predicate<Graph.Edge<GeoLocation, RoadEdge>> containsEitherEndPoint(Predicate<GeoLocation> filter) A predicate which is true if either end point of a graph edge matches the given predicate.distance()booleanstatic Predicate<Graph.Edge<GeoLocation, RoadEdge>> A predicate which is true if the edge has a defined speed, whether positive or zero.inthashCode()static Predicate<Graph.Edge<GeoLocation, RoadEdge>> A predicate which is true if the edge has a undefined speed.static Predicate<Graph.Edge<GeoLocation, RoadEdge>> A predicate which is true if the edge has a defined speed, and the speed value is 0 m/s.static RoadEdgespeed()static Function<Graph.Edge<GeoLocation, RoadEdge>, RoadEdge> speedDefault(Predicate<Graph.Edge<GeoLocation, RoadEdge>> filter, Speed defaultSpeed) A function which applies a default speed to edges with undefined speed.static Function<Graph.Edge<GeoLocation, RoadEdge>, RoadEdge> speedMultiplier(Predicate<Graph.Edge<GeoLocation, RoadEdge>> filter, double multiplicationFactor) A function which multiplies the speed limit by a given amount.static Function<Graph.Edge<GeoLocation, RoadEdge>, RoadEdge> speedReplacement(Predicate<Graph.Edge<GeoLocation, RoadEdge>> filter, Speed newSpeed) A function which replaces the speed limit by a given amount.voidwrite(ObjectOutputStream out)
-
Constructor Details
-
RoadEdge
-
-
Method Details
-
distance
-
speed
-
write
- Throws:
IOException
-
read
- Throws:
IOException
-
containsEitherEndPoint
public static Predicate<Graph.Edge<GeoLocation, RoadEdge>> containsEitherEndPoint(Predicate<GeoLocation> filter) A predicate which is true if either end point of a graph edge matches the given predicate.- Parameters:
filter- the predicate to test end points- Returns:
- a predicate on graph edges
-
containsBothEndPoints
public static Predicate<Graph.Edge<GeoLocation, RoadEdge>> containsBothEndPoints(Predicate<GeoLocation> filter) A predicate which is true if both end points of a graph edge match the given predicate.- Parameters:
filter- the predicate to test end points- Returns:
- a predicate on graph edges
-
hasZeroSpeed
A predicate which is true if the edge has a defined speed, and the speed value is 0 m/s.- Returns:
- a predicate on graph edges
-
hasDefinedSpeed
A predicate which is true if the edge has a defined speed, whether positive or zero.- Returns:
- a predicate on graph edges
-
hasUndefinedSpeed
A predicate which is true if the edge has a undefined speed.- Returns:
- a predicate on graph edges
-
speedMultiplier
public static Function<Graph.Edge<GeoLocation, RoadEdge>, RoadEdge> speedMultiplier(Predicate<Graph.Edge<GeoLocation, RoadEdge>> filter, double multiplicationFactor) A function which multiplies the speed limit by a given amount. Edges not matching the filter remain unchanged. Edges matching the filter but with undefined speed limits will also remain unchanged.- Parameters:
filter- the filter to check whether to apply the limit, not nullmultiplicationFactor- the factor by which to multiply the speed limit, > 0, finite- Returns:
- the mapping function
-
speedReplacement
public static Function<Graph.Edge<GeoLocation, RoadEdge>, RoadEdge> speedReplacement(Predicate<Graph.Edge<GeoLocation, RoadEdge>> filter, Speed newSpeed) A function which replaces the speed limit by a given amount. Edges not matching the filter remain unchanged.- Parameters:
filter- , not nullnewSpeed- the new speed limit, not null- Returns:
- the mapping function
-
speedDefault
public static Function<Graph.Edge<GeoLocation, RoadEdge>, RoadEdge> speedDefault(Predicate<Graph.Edge<GeoLocation, RoadEdge>> filter, Speed defaultSpeed) A function which applies a default speed to edges with undefined speed. Edges not matching the filter remain unchanged. Edges matching the filter but which already have a defined speed limit will also remain unchanged.- Parameters:
filter- , not nulldefaultSpeed- the new speed limit, not null- Returns:
- the mapping function
-
equals
-
hashCode
-