Class Vertex


  • public class Vertex
    extends java.lang.Object
    A class for a vertex of the graph.
    Author:
    Dmitry Moor
    • Constructor Summary

      Constructors 
      Constructor Description
      Vertex​(int id)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChildVertex​(Vertex child)  
      Vertex cloneIt()
      The method returns a deep copy of the object.
      boolean equals​(java.lang.Object other)
      (non-Javadoc)
      int getAdjacencyListIndex()
      The method returns the index of the associated adjacency list
      Vertex getChildVertex​(int i)  
      int getColor()
      The method returns the color of the vertex
      int getID()
      The method returns ID of the vertex
      int getNumberOfChilds()  
      int getPredecessor​(int i)
      The method returns the predecessor of the current vertex in the shortest path tree from some source
      double getShortestPathEst()
      The method returns the estimation for the shortest path from some source to this vertex
      double getShortestPathEst​(int i)
      The method returns the estimation for the shortest path from some source to this vertex
      boolean isAggregative()  
      void setAdjacencyListIndex​(int idx)
      The method setup the index of the adjacency list associated with this vertex
      void setColor​(int color)
      The method sets the color for the vertex
      void setPredecessor​(int p, int i)
      The method set up the predecessor of the current vertex in the shortest path tree from some source
      void setShortestPathEst​(double d, int i)
      The method set up the estimation for the shortest path from some source to this vertex
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Vertex

        public Vertex​(int id)
        Constructor
        Parameters:
        id - - identifier of the new vertex
    • Method Detail

      • cloneIt

        public Vertex cloneIt()
        The method returns a deep copy of the object.
        Returns:
        a deep copy of the class
      • equals

        public boolean equals​(java.lang.Object other)
        (non-Javadoc)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(Object)
      • getID

        public int getID()
        The method returns ID of the vertex
        Returns:
        vertex id
      • getAdjacencyListIndex

        public int getAdjacencyListIndex()
        The method returns the index of the associated adjacency list
        Returns:
        the index of the adjacency list associated with this vertex
      • getShortestPathEst

        public double getShortestPathEst​(int i)
        The method returns the estimation for the shortest path from some source to this vertex
        Parameters:
        i - - the index of shortest path estimation (there may be several estimations)
        Returns:
        the estimation
      • getShortestPathEst

        public double getShortestPathEst()
        The method returns the estimation for the shortest path from some source to this vertex
        Returns:
        the estimation
      • getPredecessor

        public int getPredecessor​(int i)
        The method returns the predecessor of the current vertex in the shortest path tree from some source
        Parameters:
        i - - the index of the predecessor (there may be several predecessors - each for one tree)
        Returns:
        the predecessor
      • getColor

        public int getColor()
        The method returns the color of the vertex
        Returns:
        the color
      • getChildVertex

        public Vertex getChildVertex​(int i)
        Parameters:
        i - index of the child
        Returns:
        the child vertex
      • getNumberOfChilds

        public int getNumberOfChilds()
      • setAdjacencyListIndex

        public void setAdjacencyListIndex​(int idx)
        The method setup the index of the adjacency list associated with this vertex
        Parameters:
        idx - - the index of the adjacency list of interest
      • setShortestPathEst

        public void setShortestPathEst​(double d,
                                       int i)
        The method set up the estimation for the shortest path from some source to this vertex
        Parameters:
        d - - the estimation
      • setPredecessor

        public void setPredecessor​(int p,
                                   int i)
        The method set up the predecessor of the current vertex in the shortest path tree from some source
      • setColor

        public void setColor​(int color)
        The method sets the color for the vertex
        Parameters:
        color - - the value of color to be set
      • addChildVertex

        public void addChildVertex​(Vertex child)
      • isAggregative

        public boolean isAggregative()