Class WayConnectionTypeCalculator
- java.lang.Object
-
- org.openstreetmap.josm.gui.dialogs.relation.sort.WayConnectionTypeCalculator
-
public class WayConnectionTypeCalculator extends Object
This class calculates theWayConnectionType
for a given list of members
-
-
Field Summary
Fields Modifier and Type Field Description private int
firstGroupIdx
private int
lastBackwardWay
private int
lastForwardWay
private List<RelationMember>
members
private boolean
onewayBeginning
private static int
UNCONNECTED
-
Constructor Summary
Constructors Constructor Description WayConnectionTypeCalculator()
-
Method Summary
-
-
-
Field Detail
-
UNCONNECTED
private static final int UNCONNECTED
- See Also:
- Constant Field Values
-
members
private List<RelationMember> members
-
firstGroupIdx
private int firstGroupIdx
-
lastForwardWay
private int lastForwardWay
-
lastBackwardWay
private int lastBackwardWay
-
onewayBeginning
private boolean onewayBeginning
-
-
Constructor Detail
-
WayConnectionTypeCalculator
public WayConnectionTypeCalculator()
-
-
Method Detail
-
updateLinks
public List<WayConnectionType> updateLinks(List<RelationMember> members)
refresh the cache of member WayConnectionTypes- Parameters:
members
- relation members- Returns:
- way connections
-
updateLinks
public List<WayConnectionType> updateLinks(Relation r, List<RelationMember> members)
refresh the cache of member WayConnectionTypes- Parameters:
r
- relation. Can be null, for plugins compatibility, but really shouldn'tmembers
- relation members- Returns:
- way connections
- Since:
- 15696
-
updateLinksFor
private WayConnectionType updateLinksFor(Relation r, List<WayConnectionType> con, WayConnectionType lastWct, int i)
-
isNoHandleableWay
private static boolean isNoHandleableWay(RelationMember m)
-
computeNextWayConnection
private WayConnectionType computeNextWayConnection(Relation r, List<WayConnectionType> con, WayConnectionType lastWct, int i, RelationMember m)
-
isSuperRoute
private boolean isSuperRoute(Relation r)
-
isOnewayIgnored
private static boolean isOnewayIgnored(Relation r)
-
handleOnewayFollows
protected void handleOnewayFollows(WayConnectionType lastWct, int i, RelationMember m, WayConnectionType wct)
-
handleOneway
private void handleOneway(WayConnectionType lastWct, int i, WayConnectionType wct)
-
makeLoopIfNeeded
private void makeLoopIfNeeded(List<WayConnectionType> con, int i)
-
determineDirectionOfFirst
private WayConnectionType.Direction determineDirectionOfFirst(int i, RelationMember m, boolean reversed)
-
determineOnewayConnectionType
private void determineOnewayConnectionType(List<WayConnectionType> con, RelationMember m, int i, WayConnectionType wct)
-
reverse
private static WayConnectionType.Direction reverse(WayConnectionType.Direction dir)
-
determineDirection
private WayConnectionType.Direction determineDirection(int refI, WayConnectionType.Direction refDirection, int k)
-
determineDirection
private WayConnectionType.Direction determineDirection(int refI, WayConnectionType.Direction refDirection, int k, boolean reversed)
Determines the direction of wayk
with respect to the wayref_i
. The wayref_i
is assumed to have the directionref_direction
and to be the predecessor ofk
. If both ways are not linked in any way, NONE is returned. Else the direction is given as follows: Let the relation be a route of oneway streets, and someone travels them in the given order. Direction is FORWARD if it is legal and BACKWARD if it is illegal to do so for the given way.- Parameters:
refI
- way keyrefDirection
- direction of ref_ik
- successor of ref_ireversed
- iftrue
determine reverse direction- Returns:
- direction of way
k
-
clear
public void clear()
Free resources.
-
isConnected
private boolean isConnected(Way way1, Way way2)
-
-