public final class NodeMatch extends AbstractSet<SourceNode> implements NodePair, Comparable<NodeMatch>
This class implements the Set interface chiefly to indicate
that instances in fact represent an unordered collection of
(exactly two) nodes. None of the optional operations in the collections
framework have been implemented, and the required operations should not be
expected to be particularly efficient.
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
genCounter |
| Constructor and Description |
|---|
NodeMatch(SourceNode node0,
SourceNode node1) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(NodeMatch that) |
boolean |
contains(Object node) |
double |
distance()
The distance of the two nodes.
|
boolean |
equals(Object object) |
int |
hashCode() |
Iterator<SourceNode> |
iterator() |
GeneralisedNode |
midPoint()
A node located exactly half-way between the two nodes.
|
SourceNode |
node0() |
SourceNode |
node1() |
SourceNode |
other(Node node)
The opposite node of the pair.
|
int |
size() |
String |
toString() |
removeAlladd, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArrayparallelStream, removeIf, streamNodeMatch(SourceNode node0, SourceNode node1)
public SourceNode node0()
public SourceNode node1()
public boolean contains(Object node)
contains in interface Collection<SourceNode>contains in interface Set<SourceNode>contains in class AbstractCollection<SourceNode>public SourceNode other(Node node)
NodePairpublic GeneralisedNode midPoint()
NodePairpublic double distance()
NodePairpublic int compareTo(NodeMatch that)
compareTo in interface Comparable<NodeMatch>public boolean equals(Object object)
equals in interface Collection<SourceNode>equals in interface Set<SourceNode>equals in class AbstractSet<SourceNode>public int hashCode()
hashCode in interface Collection<SourceNode>hashCode in interface Set<SourceNode>hashCode in class AbstractSet<SourceNode>public int size()
size in interface Collection<SourceNode>size in interface Set<SourceNode>size in class AbstractCollection<SourceNode>public Iterator<SourceNode> iterator()
iterator in interface Iterable<SourceNode>iterator in interface Collection<SourceNode>iterator in interface Set<SourceNode>iterator in class AbstractCollection<SourceNode>public String toString()
toString in class AbstractCollection<SourceNode>