/** * This function should never actually be called - it is here solely so the * xml context function can be resolved properly. The actual function is * implemented in the XML planner. * @param context The context to apply the criteria in * @param expression The expression on the left side of the criteria * @return Same as expression */ public static Object context(Object context, Object expression) throws FunctionExecutionException { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30406, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30406)); }
public static long abs(long x) throws FunctionExecutionException { if (x == Long.MIN_VALUE) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.valueOf(1)))); } return Math.abs(x); }
public static long multiply(long x, long y) throws FunctionExecutionException { if ((y > 0 && (x > Long.MAX_VALUE/y || x < Long.MIN_VALUE/y)) || ((y < -1) && (x > Long.MIN_VALUE/y || x < Long.MAX_VALUE/y)) || (y == -1 && x == Long.MIN_VALUE)) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).multiply(BigInteger.valueOf(y)))); } return x * y; }
public static int divide(int x, int y) throws FunctionExecutionException { if (x == Integer.MIN_VALUE && y == -1) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, (long)Integer.MAX_VALUE + 1)); } return x / y; }
public static Object right(String string, Integer count) throws FunctionExecutionException { int countValue = count.intValue(); if(countValue < 0) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30396, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30396, countValue)); } else if(string.length() < countValue) { return string; } else { return new String(string.substring(string.length() - countValue)); } }
public static Object left(String string, Integer count) throws FunctionExecutionException { int countValue = count.intValue(); if(countValue < 0) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30396, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30396, countValue)); } if(string.length() < countValue) { return string; } return new String(string.substring(0, countValue)); }
public static long multiply(long x, long y) throws FunctionExecutionException { if ((y > 0 && (x > Long.MAX_VALUE/y || x < Long.MIN_VALUE/y)) || ((y < -1) && (x > Long.MIN_VALUE/y || x < Long.MAX_VALUE/y)) || (y == -1 && x == Long.MIN_VALUE)) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).multiply(BigInteger.valueOf(y)))); } return x * y; }
public static long divide(long x, long y) throws FunctionExecutionException { if (x == Long.MIN_VALUE && y == -1) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.valueOf(1)))); } return x / y; }
public static int integerRangeCheck(long result) throws FunctionExecutionException { if (result > Integer.MAX_VALUE || result < Integer.MIN_VALUE) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, result)); } return (int)result; }
public static long plus(long x, long y) throws FunctionExecutionException { if (y > 0) { if (x > Long.MAX_VALUE - y) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).add(BigInteger.valueOf(y)))); } } else if (x < Long.MIN_VALUE - y) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).add(BigInteger.valueOf(y)))); } return x + y; }
public static long minus(long x, long y) throws FunctionExecutionException { if (y > 0) { if (x < Long.MIN_VALUE + y) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).subtract(BigInteger.valueOf(y)))); } } else if (x > Long.MAX_VALUE + y) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).subtract(BigInteger.valueOf(y)))); } return x - y; }
public static Object right(String string, Integer count) throws FunctionExecutionException { int countValue = count.intValue(); if(countValue < 0) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30396, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30396, countValue)); } else if(string.length() < countValue) { return string; } else { return new String(string.substring(string.length() - countValue)); } }
public static long minus(long x, long y) throws FunctionExecutionException { if (y > 0) { if (x < Long.MIN_VALUE + y) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).subtract(BigInteger.valueOf(y)))); } } else if (x > Long.MAX_VALUE + y) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).subtract(BigInteger.valueOf(y)))); } return x - y; }
public static long abs(long x) throws FunctionExecutionException { if (x == Long.MIN_VALUE) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.valueOf(1)))); } return Math.abs(x); }
public static Object left(String string, Integer count) throws FunctionExecutionException { int countValue = count.intValue(); if(countValue < 0) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30396, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30396, countValue)); } if(string.length() < countValue) { return string; } return new String(string.substring(0, countValue)); }
public static int plus(int x, int y) throws FunctionExecutionException { long result = (long)x + y; if (result > Integer.MAX_VALUE || result < Integer.MIN_VALUE) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, result)); } return (int)result; }
public static long plus(long x, long y) throws FunctionExecutionException { if (y > 0) { if (x > Long.MAX_VALUE - y) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).add(BigInteger.valueOf(y)))); } } else if (x < Long.MIN_VALUE - y) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).add(BigInteger.valueOf(y)))); } return x + y; }
public static int minus(int x, int y) throws FunctionExecutionException { long result = (long)x - y; if (result > Integer.MAX_VALUE || result < Integer.MIN_VALUE) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, result)); } return (int)result; }
public static long minus(long x, long y) throws FunctionExecutionException { if (y > 0) { if (x < Long.MIN_VALUE + y) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).subtract(BigInteger.valueOf(y)))); } } else if (x > Long.MAX_VALUE + y) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, BigInteger.valueOf(x).subtract(BigInteger.valueOf(y)))); } return x - y; }
public static int multiply(int x, int y) throws FunctionExecutionException { long result = (long)x * y; if (result > Integer.MAX_VALUE || result < Integer.MIN_VALUE) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31169, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31169, result)); } return (int)result; }