package org.vertexium.cypher.functions.math; import org.vertexium.cypher.VertexiumCypherQueryContext; import org.vertexium.cypher.ast.model.CypherAstBase; import org.vertexium.cypher.executor.ExpressionScope; import org.vertexium.cypher.functions.CypherFunction; import java.util.Random; public class RandFunction extends CypherFunction { private final Random random = new Random(); @Override public Object invoke(VertexiumCypherQueryContext ctx, CypherAstBase[] arguments, ExpressionScope scope) { assertArgumentCount(arguments, 0); return random.nextDouble(); } @Override public boolean isConstant() { return false; } }