Class AbstractHighwayMatrix.HighwayPtr

  • Enclosing class:
    AbstractHighwayMatrix

    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
        Parameters:
        highway - - the highway
        index - - the index
    • Method Detail

      • hashCode

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

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

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