Package org.openstreetmap.josm.data.osm
Class NodePair
java.lang.Object
org.openstreetmap.josm.data.osm.NodePair
A directed pair of nodes (a,b != b,a).
- Since:
- 12463 (extracted from CombineWayAction)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if this pair contains the given node.booleangetA()Replies the first node.getB()Replies the second nodeinthashCode()booleanisPredecessorOf(NodePair other) Determines if this pair is predecessor of another one (this.b == other.a)booleanisSuccessorOf(NodePair other) Determines if this pair is successor of another one (other.b == this.a)swap()Returns the inversed pair.toString()
-
Field Details
-
a
-
b
-
-
Constructor Details
-
NodePair
Constructs a newNodePair.- Parameters:
a- The first nodeb- The second node
-
NodePair
Constructs a newNodePair.- Parameters:
pair- An existingPairof nodes
-
-
Method Details
-
getA
Replies the first node.- Returns:
- The first node
-
getB
Replies the second node- Returns:
- The second node
-
isSuccessorOf
Determines if this pair is successor of another one (other.b == this.a)- Parameters:
other- other pair- Returns:
trueif other.b == this.a
-
isPredecessorOf
Determines if this pair is predecessor of another one (this.b == other.a)- Parameters:
other- other pair- Returns:
trueif this.b == other.a
-
swap
Returns the inversed pair.- Returns:
- swapped copy
-
toString
-
contains
Determines if this pair contains the given node.- Parameters:
n- The node to look for- Returns:
trueifnis in the pair,falseotherwise
-
hashCode
-
equals
-