1 10 package com.hp.hpl.jena.reasoner.rulesys.builtins; 11 12 13 import com.hp.hpl.jena.reasoner.rulesys.*; 14 import com.hp.hpl.jena.graph.*; 15 16 19 25 public class LessThan extends BaseBuiltin { 26 27 31 public String getName() { 32 return "lessThan"; 33 } 34 35 38 public int getArgLength() { 39 return 2; 40 } 41 42 50 public boolean bodyCall(Node[] args, int length, RuleContext context) { 51 checkArgs(length, context); 52 Node n0 = getArg(0, args, context); 53 Node n1 = getArg(1, args, context); 54 if ( Util.isNumeric(n0) && Util.isNumeric(n1) ) { 55 return Util.compareNumbers(n0, n1) < 0; 56 } else if (Util.isInstant(n0) && Util.isInstant(n1)) { 57 return Util.compareInstants(n0, n1) < 0; 58 } else { 59 return false; 60 } 61 } 62 63 } 64 65 | Popular Tags |