Class AbstractHighwayMatrix.HighwayPtr

  • Enclosing class:

    protected static class AbstractHighwayMatrix.HighwayPtr
    extends Object
    Wrapper on the Highway. Contains index of the highway in the highways list for quick operation of the get index of element. Overrides hashCode() and equals() for quick operations with hash map and hash set.
    • Field Detail

      • highway

        public final Highway highway
        the wrapped element
      • index

        public int index
        the index on the highways list
    • Constructor Detail

      • HighwayPtr

        public HighwayPtr​(Highway highway,
                          int index)
        Create HighwayPtr using specified highway and index
        highway - - the highway
        index - - the index
    • Method Detail

      • hashCode

        public int hashCode()
        Returns the index
        hashCode in class Object
        the index
      • equals

        public boolean equals​(Object obj)
        Compares the indexes (after standart checks of the null and type).
        equals in class Object
      • toString

        public String toString()
        Returns the string in the format: <index>: <highway.ToString()>
        toString in class Object