Interface TreePathMaxima.IQueries

    • Method Detail

      • newInstance

        static TreePathMaxima.IQueries newInstance()
        Create an empty queries container.
        Returns:
        a new queries container
      • addQuery

        void addQuery​(int u,
                      int v)
        Add a query for the heaviest edge in a tree between two vertices.
        Parameters:
        u - the first vertex
        v - the second vertex
      • getQuerySourceInt

        int getQuerySourceInt​(int idx)
        Get a query source by index.

        A query is composed of two vertices, the source and the target. This method return the source vertex of a query. Use getQueryTargetInt(int) to get the target vertex.

        Parameters:
        idx - index of the query. Must be in range [0, size())
        Returns:
        the first vertex of the query
        Throws:
        IndexOutOfBoundsException - if idx < 0 or idx >= size()
      • getQueryTargetInt

        int getQueryTargetInt​(int idx)
        Get a query target by index.

        A query is composed of two vertices, the target and the source. This method return the target vertex of a query. Use getQueryTargetInt(int) to get the source vertex.

        Parameters:
        idx - index of the query. Must be in range [0, size())
        Returns:
        the second vertex of the query
        Throws:
        IndexOutOfBoundsException - if idx < 0 or idx >= size()