Package org.openstreetmap.josm.data.osm
Class NodePair
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.NodePair
-
public class NodePair extends java.lang.Object
A directed pair of nodes (a,b != b,a).- Since:
- 12463 (extracted from CombineWayAction)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(Node n)Determines if this pair contains the given node.booleanequals(java.lang.Object obj)NodegetA()Replies the first node.NodegetB()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)NodePairswap()Returns the inversed pair.java.lang.StringtoString()
-
-
-
Method Detail
-
isSuccessorOf
public boolean isSuccessorOf(NodePair other)
Determines if this pair is successor of another one (other.b == this.a)- Parameters:
other- other pair- Returns:
trueif other.b == this.a
-
isPredecessorOf
public boolean isPredecessorOf(NodePair other)
Determines if this pair is predecessor of another one (this.b == other.a)- Parameters:
other- other pair- Returns:
trueif this.b == other.a
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
contains
public boolean contains(Node n)
Determines if this pair contains the given node.- Parameters:
n- The node to look for- Returns:
trueifnis in the pair,falseotherwise
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-