public void doTestComparator(Node nLow, Node nHigh) { assertEquals(0, Util.compareTypedLiterals(nLow, nLow)); assertEquals(-1, Util.compareTypedLiterals(nLow, nHigh)); assertEquals(1, Util.compareTypedLiterals(nHigh, nLow)); }
public void doTestComparator(Node nLow, Node nHigh) { assertEquals(0, Util.compareTypedLiterals(nLow, nLow)); assertEquals(-1, Util.compareTypedLiterals(nLow, nHigh)); assertEquals(1, Util.compareTypedLiterals(nHigh, nLow)); }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) <= 0; } else { return false; } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) > 0; } else { return false; } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) < 0; } else { return false; } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) >= 0; } else { return false; } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) <= 0; } else { return false; } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) >= 0; } else { return false; } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) > 0; } else { return false; } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) < 0; } else { return false; } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param length the length of the argument list, may be less than the length of the args array * for some rule engines * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) == 0; } else { return n1.sameValueAs(n2); } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param length the length of the argument list, may be less than the length of the args array * for some rule engines * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) == 0; } else { return n1.sameValueAs(n2); } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param length the length of the argument list, may be less than the length of the args array * for some rule engines * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) != 0; } else { return ! n1.sameValueAs(n2); } }
/** * This method is invoked when the builtin is called in a rule body. * @param args the array of argument values for the builtin, this is an array * of Nodes, some of which may be Node_RuleVariables. * @param length the length of the argument list, may be less than the length of the args array * for some rule engines * @param context an execution context giving access to other relevant data * @return return true if the buildin predicate is deemed to have succeeded in * the current environment */ @Override public boolean bodyCall(Node[] args, int length, RuleContext context) { checkArgs(length, context); Node n1 = getArg(0, args, context); Node n2 = getArg(1, args, context); if (Util.comparable(n1, n2)) { return Util.compareTypedLiterals(n1, n2) != 0; } else { return ! n1.sameValueAs(n2); } }