public class OverlayPathImpl extends java.lang.Object implements OverlayPath
| Modifier and Type | Field and Description |
|---|---|
static java.util.Comparator<OverlayPath> |
COMP_DIST |
static java.util.Comparator<OverlayPath> |
COMP_FLAT |
EMPTY_PATH, UNMARSHALL| Constructor and Description |
|---|
OverlayPathImpl(long inVersion,
int... inLocation) |
| Modifier and Type | Method and Description |
|---|---|
static int[] |
between(OverlayPath treeLocA,
OverlayPath treeLocB) |
OverlayPath |
branchPath(int inMemberId)
Return a near copy of this path, adding an additional node.
|
OverlayPath |
branchPath(long inVersion,
int inMemberId)
Return a near copy of this path, adding an additional node, and changing
the overlay version.
|
int |
distanceTo(OverlayPath inDestPath)
The number of hops to reach the given destination using primary links.
|
boolean |
equals(java.lang.Object inObj) |
int |
getNodeID() |
int[] |
getPath() |
long |
getVersion() |
int |
hashCode() |
static int[] |
longestPrefix(OverlayPath treeLocA,
OverlayPath treeLocB) |
void |
marshall(FormatWriter mFormat) |
boolean |
onPathOf(OverlayPath inDestPath)
True is this location is on the path of the given destination.
|
OverlayPath |
returnPath()
Reverse this path, creating a return routing path.
|
java.lang.String |
toString() |
OverlayPath |
unmarshall(FormatReader mFormat) |
public static final java.util.Comparator<OverlayPath> COMP_FLAT
public static final java.util.Comparator<OverlayPath> COMP_DIST
public long getVersion()
getVersion in interface OverlayPathpublic int getNodeID()
getNodeID in interface OverlayPathpublic int[] getPath()
getPath in interface OverlayPathpublic boolean onPathOf(OverlayPath inDestPath)
OverlayPathonPathOf in interface OverlayPathinDestPath - - The destination location/path.public int distanceTo(OverlayPath inDestPath)
OverlayPathdistanceTo in interface OverlayPathinDestPath - - The destination location/path.public OverlayPath branchPath(int inMemberId)
OverlayPathbranchPath in interface OverlayPathinMemberId - - The node ID to add.public OverlayPath branchPath(long inVersion, int inMemberId)
OverlayPathbranchPath in interface OverlayPathinVersion - - The overlay version to route using.inMemberId - - The node ID to add.public OverlayPath returnPath()
OverlayPathreturnPath in interface OverlayPathpublic boolean equals(java.lang.Object inObj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic void marshall(FormatWriter mFormat) throws FormatException
marshall in interface FormatMarshallermFormat - - The format writer to write toFormatException - If there was a problem while writingpublic OverlayPath unmarshall(FormatReader mFormat) throws FormatException
unmarshall in interface FormatUnmarshaller<OverlayPath>mFormat - - The format reader to read fromFormatException - If there was a problem while readingpublic static int[] longestPrefix(OverlayPath treeLocA, OverlayPath treeLocB)
public static int[] between(OverlayPath treeLocA, OverlayPath treeLocB)