Package game

Class NodeStatus

java.lang.Object
game.NodeStatus
All Implemented Interfaces:
Comparable<NodeStatus>

public final class NodeStatus extends Object implements Comparable<NodeStatus>
Status of a graph node
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    If the distances of this and other are equal, return neg, 0 or pos depending on whether this id is less than, equal to, or greater than other's id.
    boolean
    Return true iff ob is a NodeStatus with the same id as this one.
    int
    Return the distance to the ring from the Node that corresponds br>to this NodeStatus.
    long
    Return the Id of the Node that corresponds to this NodeStatus.
    int
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getId

      public long getId()
      Return the Id of the Node that corresponds to this NodeStatus.
    • getDistanceToRing

      public int getDistanceToRing()
      Return the distance to the ring from the Node that corresponds br>to this NodeStatus.
    • compareTo

      public int compareTo(NodeStatus other)
      If the distances of this and other are equal, return neg, 0 or pos depending on whether this id is less than, equal to, or greater than other's id. Otherwise, return neg, or pos number depending on whether this's distance is less than or greater than other's distance.
      Specified by:
      compareTo in interface Comparable<NodeStatus>
    • equals

      public boolean equals(Object ob)
      Return true iff ob is a NodeStatus with the same id as this one. We don't have to be concerned with ob being a subclass of NodeStatus because this class is declared final.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object