Struct NodeDistance<TNode>
Node-distance pair.
Assembly: Mars.Common.dll
Syntax
public struct NodeDistance<TNode> : IComparable<NodeDistance<TNode>>, IEquatable<NodeDistance<TNode>>
Type Parameters
Name |
Description |
TNode |
The class type for the nodes of the tree. |
Constructors
NodeDistance(TNode, Double)
Declaration
public NodeDistance(TNode node, double distance)
Parameters
Type |
Name |
Description |
TNode |
node |
The node value. |
System.Double |
distance |
The distance value. |
Properties
Distance
Gets the distance of the node from the query point.
Declaration
public double Distance { get; }
Property Value
Type |
Description |
System.Double |
|
Node
Gets the node in this pair.
Declaration
public TNode Node { get; }
Property Value
Methods
CompareTo(NodeDistance<TNode>)
Compares this instance to another node, returning an integer
indicating whether this instance has a distance that is less
than, equal to, or greater than the other node's distance.
Declaration
public int CompareTo(NodeDistance<TNode> other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
CompareTo(Object)
Compares this instance to another node, returning an integer
indicating whether this instance has a distance that is less
than, equal to, or greater than the other node's distance.
Declaration
public int CompareTo(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Int32 |
|
Equals(NodeDistance<TNode>)
Declaration
public bool Equals(NodeDistance<TNode> other)
Parameters
Returns
Type |
Description |
System.Boolean |
true if the specified NodeDistance<TNode> is
equal to this instance; otherwise, false .
|
Equals(Object)
Determines whether the specified
is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
The to compare
with this instance.
|
Returns
Type |
Description |
System.Boolean |
true if the specified is
equal to this instance; otherwise, false .
|
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
A hash code for this instance, suitable for use in hashing
algorithms and data structures like a hash table.
|
ToString()
Returns a that represents this instance.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
A that represents this instance.
|
Operators
Equality(NodeDistance<TNode>, NodeDistance<TNode>)
Implements the equality operator.
Declaration
public static bool operator ==(NodeDistance<TNode> a, NodeDistance<TNode> b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GreaterThan(NodeDistance<TNode>, NodeDistance<TNode>)
Implements the greater than operator.
Declaration
public static bool operator>(NodeDistance<TNode> a, NodeDistance<TNode> b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Inequality(NodeDistance<TNode>, NodeDistance<TNode>)
Implements the inequality operator.
Declaration
public static bool operator !=(NodeDistance<TNode> a, NodeDistance<TNode> b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
LessThan(NodeDistance<TNode>, NodeDistance<TNode>)
Implements the lesser than operator.
Declaration
public static bool operator <(NodeDistance<TNode> a, NodeDistance<TNode> b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
IComparable<>
IEquatable<>
Extension Methods