Skip to content

Commit

Permalink
chore: rename iThis to self
Browse files Browse the repository at this point in the history
  • Loading branch information
robfrank committed Jan 15, 2025
1 parent 886745b commit 0abd95b
Show file tree
Hide file tree
Showing 55 changed files with 65 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public SQLFunction getFunction(final String name) {
// WRAP LIBRARY FUNCTION TO SQL FUNCTION TO BE EXECUTED BY SQL ENGINE
sqlFunction = new SQLFunctionAbstract(name) {
@Override
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult,
final Object[] params,
final CommandContext context) {
return function.execute(params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface SQLFunction {
/**
* Process a record.
*
* @param iThis
* @param self
* @param currentRecord : current record
* @param currentResult TODO
* @param params : function parameters, number is ensured to be within minParams and maxParams.
Expand All @@ -44,7 +44,7 @@ public interface SQLFunction {
* @return function result, can be null. Special cases : can be null if function aggregate results, can be null if function filter
* results : this mean result is excluded
*/
Object execute(Object iThis, Identifiable currentRecord, Object currentResult, Object[] params, CommandContext context);
Object execute(Object self, Identifiable currentRecord, Object currentResult, Object[] params, CommandContext context);

/**
* Configure the function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ public interface SQLMethod extends Comparable<SQLMethod> {
/**
* Process a record.
*
* @param iThis current object
* @param self current object
* @param currentRecord : current record
* @param context execution context
* @param params : function parameters, number is ensured to be within minParams and maxParams.
*
* @return evaluation result
*/
Object execute(Object iThis, Identifiable currentRecord, CommandContext context, Object[] params);
Object execute(Object self, Identifiable currentRecord, CommandContext context, Object[] params);

boolean evaluateParameters();
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public SQLFunctionDifference() {
}

@SuppressWarnings("unchecked")
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params[0] == null)
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public SQLFunctionFirst() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
final Object value = params[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public SQLFunctionIntersect() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext ctx) {
Object value = params[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public SQLFunctionLast() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
final Object value = params[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public SQLFunctionList() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext ctx) {
if (params.length > 1)
// IN LINE MODE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public SQLFunctionMap() {
}

@SuppressWarnings("unchecked")
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext ctx) {

if (params.length > 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public SQLFunctionSet() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext ctx) {
if (params.length > 1)
// IN LINE MODE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static void addItemsToResult(final Collection<Object> co, final Set<Obje
}

@SuppressWarnings("unchecked")
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext ctx) {
if (params[0] == null)
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SQLFunctionUnionAll() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext ctx) {
if (params.length == 1) {
// AGGREGATION MODE (STATEFUL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public SQLFunctionCircle() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params.length != 3)
throw new IllegalArgumentException("circle() requires 3 parameters");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public SQLFunctionDistance() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
double distance;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SQLFunctionLineString() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params.length != 1)
throw new IllegalArgumentException("lineString() requires array of points as parameters");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public SQLFunctionPoint() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params.length != 2)
throw new IllegalArgumentException("point() requires X and Y as parameters");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SQLFunctionPolygon() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params.length != 1)
throw new IllegalArgumentException("polygon() requires array of points as parameters");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public SQLFunctionRectangle() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params.length != 4)
throw new IllegalArgumentException("rectangle() requires 4 parameters");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public SQLFunctionAstar() {
super(NAME);
}

public LinkedList<Vertex> execute(final Object iThis, final Identifiable currentRecord, final Object currentResult,
public LinkedList<Vertex> execute(final Object self, final Identifiable currentRecord, final Object currentResult,
final Object[] params, final CommandContext ctx) {
context = ctx;
final SQLFunctionAstar context = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public String getSyntax() {
return "Syntax error: " + name + "([<labels>])";
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult,
final Object[] iParameters, final CommandContext context) {

final String[] labels;
Expand All @@ -54,7 +54,7 @@ public Object execute(final Object iThis, final Identifiable currentRecord, fina
else
labels = null;

return SQLQueryEngine.foreachRecord(iArgument -> move(context.getDatabase(), iArgument, labels), iThis, context);
return SQLQueryEngine.foreachRecord(iArgument -> move(context.getDatabase(), iArgument, labels), self, context);
}

protected Object v2v(final Database graph, final Identifiable iRecord, final Vertex.DIRECTION iDirection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ protected SQLFunctionMoveFiltered(final String name) {
}

@Override
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult,
final Object[] iParameters, final Iterable<Identifiable> iPossibleResults, final CommandContext context) {
final String[] labels;
if (iParameters != null && iParameters.length > 0 && iParameters[0] != null)
labels = MultiValue.array(iParameters, String.class, FileUtils::getStringContent);
else
labels = null;

return SQLQueryEngine.foreachRecord(iArgument -> move(context.getDatabase(), iArgument, labels, iPossibleResults), iThis,
return SQLQueryEngine.foreachRecord(iArgument -> move(context.getDatabase(), iArgument, labels, iPossibleResults), self,
context);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static class ShortestPathContext {
public Boolean edge;
}

public List<RID> execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public List<RID> execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {

final ShortestPathContext shortestPathContext = new ShortestPathContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public SQLFunctionAbsoluteValue() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable record, final Object currentResult, final Object[] params, final CommandContext context) {
public Object execute(final Object self, final Identifiable record, final Object currentResult, final Object[] params, final CommandContext context) {
final Object inputValue = params[0];

if (inputValue == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public SQLFunctionAverage() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params.length == 1) {
if (params[0] instanceof Number number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public SQLFunctionCount() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params.length == 0 || params[0] != null)
total++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public SQLFunctionEval() {
super(NAME);
}

public Object execute(Object iThis, final Identifiable record, final Object currentResult, final Object[] params, CommandContext context) {
public Object execute(Object self, final Identifiable record, final Object currentResult, final Object[] params, CommandContext context) {
if (params.length < 1)
throw new CommandExecutionException("invalid expression");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public SQLFunctionMax() {
}

@SuppressWarnings({ "unchecked", "rawtypes" })
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext ctx) {
// calculate max value for current record
// consider both collection of parameters and collection in each parameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public SQLFunctionMin() {
}

@SuppressWarnings({ "unchecked", "rawtypes" })
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext ctx) {

// calculate min value for current record
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public SQLFunctionMode() {
}

@Override
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {

if (MultiValue.isMultiValue(params[0])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public SQLFunctionPercentile(final String iName) {
}

@Override
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {

if (quantiles.isEmpty()) { // set quantiles once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public SQLFunctionRandomInt() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params == null || params.length < 1)
throw new CommandSQLParsingException("Expected maximum value in function");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public SQLFunctionSquareRoot() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable record, final Object currentResult, final Object[] params, final CommandContext context) {
public Object execute(final Object self, final Identifiable record, final Object currentResult, final Object[] params, final CommandContext context) {
final Object inputValue = params[0];

if (inputValue == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public SQLFunctionSum() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params.length == 1) {
if (params[0] instanceof Number number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected SQLFunctionVariance(final String name) {
}

@Override
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params[0] instanceof Number number) {
addValue(number);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public SQLFunctionBoolAnd() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params.length == 1) {
if (params[0] instanceof Boolean boolean1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public SQLFunctionBoolOr() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
if (params.length == 1) {
if (params[0] instanceof Boolean boolean1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public SQLFunctionCoalesce() {
}

@Override
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {
final int length = params.length;
for (int i = 0; i < length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public SQLFunctionDecode() {
}

@Override
public Object execute( final Object iThis, final Identifiable currentRecord, final Object currentResult,
public Object execute( final Object self, final Identifiable currentRecord, final Object currentResult,
final Object[] params, final CommandContext context) {

final String candidate = params[0].toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public SQLFunctionEncode() {
super(NAME);
}

public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params,
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params,
final CommandContext context) {

final Object candidate = params[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public SQLFunctionIf() {
}

@Override
public Object execute(final Object iThis, final Identifiable currentRecord, final Object currentResult, final Object[] params, final CommandContext context) {
public Object execute(final Object self, final Identifiable currentRecord, final Object currentResult, final Object[] params, final CommandContext context) {

final boolean result;

Expand Down
Loading

0 comments on commit 0abd95b

Please sign in to comment.