Class SQLFunctionPathFinder
- java.lang.Object
-
- com.arcadedb.query.sql.function.SQLFunctionAbstract
-
- com.arcadedb.query.sql.function.SQLFunctionConfigurableAbstract
-
- com.arcadedb.query.sql.function.math.SQLFunctionMathAbstract
-
- com.arcadedb.query.sql.function.graph.SQLFunctionPathFinder
-
- All Implemented Interfaces:
SQLFunction
- Direct Known Subclasses:
SQLFunctionDijkstra
public abstract class SQLFunctionPathFinder extends SQLFunctionMathAbstract
Abstract class to find paths between nodes.- Author:
- Luca Garulli (l.garulli--(at)--gmail.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected CommandContext
context
protected Map<RID,Float>
distance
protected static float
MIN
protected Vertex
paramDestinationVertex
protected Vertex.DIRECTION
paramDirection
protected Vertex
paramSourceVertex
protected Map<RID,Vertex>
predecessors
protected Set<Vertex>
unSettledNodes
-
Fields inherited from class com.arcadedb.query.sql.function.SQLFunctionConfigurableAbstract
configuredParameters
-
Fields inherited from class com.arcadedb.query.sql.function.SQLFunctionAbstract
name
-
-
Constructor Summary
Constructors Constructor Description SQLFunctionPathFinder(String iName, int iMinParams, int iMaxParams)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
aggregateResults()
A function can make calculation on several records before returning a result.protected boolean
continueTraversing()
protected LinkedList<Vertex>
execute(CommandContext iContext)
protected void
findMinimalDistances(Vertex node)
protected abstract float
getDistance(Vertex node, Vertex target)
protected Vertex
getMinimum(Set<Vertex> vertexes)
protected Set<Vertex>
getNeighbors(Vertex node)
LinkedList<Vertex>
getPath()
Object
getResult()
Only called when function aggregates results after all records have been passed to the function.protected float
getShortestDistance(Vertex destination)
protected boolean
isNotSettled(Vertex vertex)
protected boolean
isVariableEdgeWeight()
protected float
sumDistances(float iDistance1, float iDistance2)
-
Methods inherited from class com.arcadedb.query.sql.function.math.SQLFunctionMathAbstract
getClassWithMorePrecision, getContextValue
-
Methods inherited from class com.arcadedb.query.sql.function.SQLFunctionConfigurableAbstract
config, toString
-
Methods inherited from class com.arcadedb.query.sql.function.SQLFunctionAbstract
getName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.arcadedb.query.sql.executor.SQLFunction
execute, getSyntax
-
-
-
-
Field Detail
-
paramSourceVertex
protected Vertex paramSourceVertex
-
paramDestinationVertex
protected Vertex paramDestinationVertex
-
paramDirection
protected Vertex.DIRECTION paramDirection
-
context
protected CommandContext context
-
MIN
protected static final float MIN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SQLFunctionPathFinder
public SQLFunctionPathFinder(String iName, int iMinParams, int iMaxParams)
-
-
Method Detail
-
execute
protected LinkedList<Vertex> execute(CommandContext iContext)
-
isVariableEdgeWeight
protected boolean isVariableEdgeWeight()
-
getPath
public LinkedList<Vertex> getPath()
-
aggregateResults
public boolean aggregateResults()
Description copied from interface:SQLFunction
A function can make calculation on several records before returning a result.Example of such function : sum, count, max, min ...
The final result of the aggregation is obtained by calling
SQLFunction.getResult()
- Specified by:
aggregateResults
in interfaceSQLFunction
- Overrides:
aggregateResults
in classSQLFunctionMathAbstract
- Returns:
- true if function aggregate results
-
getResult
public Object getResult()
Description copied from interface:SQLFunction
Only called when function aggregates results after all records have been passed to the function.- Specified by:
getResult
in interfaceSQLFunction
- Overrides:
getResult
in classSQLFunctionAbstract
- Returns:
- Aggregation result
-
findMinimalDistances
protected void findMinimalDistances(Vertex node)
-
isNotSettled
protected boolean isNotSettled(Vertex vertex)
-
continueTraversing
protected boolean continueTraversing()
-
getShortestDistance
protected float getShortestDistance(Vertex destination)
-
sumDistances
protected float sumDistances(float iDistance1, float iDistance2)
-
-