private int isPredecessorOrSelfOf(final NetworkNode networkNode) {

		NetworkNode tmp = networkNode;
		int steps = 0;
		while (tmp != null) {

			if (this.equals(tmp)) {
				return steps;
			}

			tmp = tmp.getParentNode();
			++steps;
		}

		return -1;
	}
private int isPredecessorOrSelfOf ( final NetworkNode networkNode ) { NetworkNode tmp = networkNode ; int steps = 0 ; while ( tmp != null ) { if ( this . equals ( tmp ) ) { return steps ; } tmp = tmp . getParentNode ( ) ; ++ steps ; } return - 1 ; }
Checks whether this node is a predecessor or the identity (the node itself) of the given network node in the
network topology tree.

@param networkNode
a potential child network node
@return If this node node is a predecessor of given node in the network topology tree, the return value
indicates the distance between both nodes. If the given node equals this node, the
return value is <code>0</code>. Otherwise the return value is <code>-1</code>.