Package com.jgalgo.alg.tree
Interface TreePathMaxima.IQueries
- All Superinterfaces:
TreePathMaxima.Queries<Integer,
Integer>
- Enclosing interface:
TreePathMaxima
Queries container for
TreePathMaxima
computations for IntGraph
.- Author:
- Barak Ugav
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addQuery
(int u, int v) Add a query for the heaviest edge in a tree between two vertices.default void
Deprecated.default Integer
getQuerySource
(int idx) Deprecated.Please usegetQuerySourceInt(int)
instead to avoid un/boxing.int
getQuerySourceInt
(int idx) Get a query source by index.default Integer
getQueryTarget
(int idx) Deprecated.Please usegetQueryTargetInt(int)
instead to avoid un/boxing.int
getQueryTargetInt
(int idx) Get a query target by index.static TreePathMaxima.IQueries
Create an empty queries container.Methods inherited from interface com.jgalgo.alg.tree.TreePathMaxima.Queries
clear, size
-
Method Details
-
newInstance
Create an empty queries container.- Parameters:
g
- the graph on which the TMP computation will be performed- 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 vertexv
- the second vertex
-
addQuery
Deprecated.Please useaddQuery(int, int)
instead to avoid un/boxing.Add a query for the heaviest edge in a tree between two vertices.- Specified by:
addQuery
in interfaceTreePathMaxima.Queries<Integer,
Integer> - Parameters:
u
- the first vertexv
- 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
- ifidx < 0
oridx >= size()
-
getQuerySource
Deprecated.Please usegetQuerySourceInt(int)
instead to avoid un/boxing.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
TreePathMaxima.Queries.getQueryTarget(int)
to get the target vertex.- Specified by:
getQuerySource
in interfaceTreePathMaxima.Queries<Integer,
Integer> - Parameters:
idx
- index of the query. Must be in range[0, size())
- Returns:
- the first vertex of the query
-
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
- ifidx < 0
oridx >= size()
-
getQueryTarget
Deprecated.Please usegetQueryTargetInt(int)
instead to avoid un/boxing.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
TreePathMaxima.Queries.getQueryTarget(int)
to get the source vertex.- Specified by:
getQueryTarget
in interfaceTreePathMaxima.Queries<Integer,
Integer> - Parameters:
idx
- index of the query. Must be in range[0, size())
- Returns:
- the second vertex of the query
-
addQuery(int, int)
instead to avoid un/boxing.