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 boolean
contains(Node n)
Determines if this pair contains the given node.boolean
equals(java.lang.Object obj)
Node
getA()
Replies the first node.Node
getB()
Replies the second nodeint
hashCode()
boolean
isPredecessorOf(NodePair other)
Determines if this pair is predecessor of another one (this.b == other.a)boolean
isSuccessorOf(NodePair other)
Determines if this pair is successor of another one (other.b == this.a)NodePair
swap()
Returns the inversed pair.java.lang.String
toString()
-
-
-
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:
true
if 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:
true
if this.b == other.a
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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:
true
ifn
is in the pair,false
otherwise
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-