public Object executeReverse(Object targetObjects, OCommandContext ctx) {
if (!isBidirectional()) {
throw new UnsupportedOperationException();
}
String straightName = methodName.getStringValue();
if (straightName.equalsIgnoreCase("out")) {
return execute(targetObjects, ctx, "in", params, null);
}
if (straightName.equalsIgnoreCase("in")) {
return execute(targetObjects, ctx, "out", params, null);
}
if (straightName.equalsIgnoreCase("both")) {
return execute(targetObjects, ctx, "both", params, null);
}
if (straightName.equalsIgnoreCase("outE")) {
return execute(targetObjects, ctx, "outV", params, null);
}
if (straightName.equalsIgnoreCase("outV")) {
return execute(targetObjects, ctx, "outE", params, null);
}
if (straightName.equalsIgnoreCase("inE")) {
return execute(targetObjects, ctx, "inV", params, null);
}
if (straightName.equalsIgnoreCase("inV")) {
return execute(targetObjects, ctx, "inE", params, null);
}
throw new UnsupportedOperationException("Invalid reverse traversal: " + methodName);
}