public Literal literal(boolean b) { return b ? new LiteralExpressionImpl(Boolean.TRUE) : new LiteralExpressionImpl(Boolean.FALSE); }
public Literal literal(short s) { return new LiteralExpressionImpl(s); }
public Literal literal(char c) { return new LiteralExpressionImpl(c); }
public Literal literal(int i) { return new LiteralExpressionImpl(i); }
public Literal literal(long l) { return new LiteralExpressionImpl(l); }
public Literal literal(float f) { return new LiteralExpressionImpl(f); }
public Literal literal(byte b) { return new LiteralExpressionImpl(b); }
public Literal literal(double d) { return new LiteralExpressionImpl(d); }
public Literal literal(Object obj) { try { return new LiteralExpressionImpl(obj); } catch (IllegalFilterException e) { new IllegalArgumentException().initCause(e); } return null; }
public void testInvalidConstruction1() throws Exception { try { Literal a = new LiteralExpressionImpl(new Double(10)); Literal b = new LiteralExpressionImpl(a); } catch (IllegalFilterException ife) { return; } }
private void updateExpression2() { // this is temporary until set...XY are removed Literal expression = new LiteralExpressionImpl( boundingPolygon(buildEnvelope(minx, maxx, miny, maxy, srs))); super.setExpression2(expression); }
public BBOXImpl( Expression name, double minx, double miny, double maxx, double maxy, String srs) { this( name, new LiteralExpressionImpl(boundingPolygon(new Envelope(minx, maxx, miny, maxy)))); this.srs = srs; }
public void testValidConstruction() throws Exception { Literal a = new LiteralExpressionImpl(new Double(10)); Literal b = new LiteralExpressionImpl("Label"); Literal c = new LiteralExpressionImpl(Integer.valueOf(10)); GeometryFactory gf = new GeometryFactory(new PrecisionModel()); Literal d = new LiteralExpressionImpl(gf.createGeometryCollection(null)); }
public void testGetParameters() { final List expected = Collections.singletonList(new LiteralExpressionImpl(10d)); // do not try this at home function.params = expected; assertEquals(expected, function.getParameters()); }
public void testSetParameters() { final List expected = Collections.singletonList(new LiteralExpressionImpl(10d)); // do not try this at home function.setParameters(expected); assertEquals(expected, function.params); }
public void testSetArgs() { final List expected = Collections.singletonList(new LiteralExpressionImpl(10d)); function.setParameters(expected); assertEquals(expected, function.params); }
public void testGetArgs() { final List expected = Collections.singletonList(new LiteralExpressionImpl(10d)); function.setParameters(expected); List<Expression> actual = function.getParameters(); assertEquals(expected, actual); }
public void testGetArgCount() { final List expected = Collections.singletonList(new LiteralExpressionImpl(10d)); function.setParameters(expected); assertEquals(1, function.getFunctionName().getArgumentCount()); }
public void testGeometryFilter() throws IllegalFilterException { Disjoint geomFilter1 = ff.disjoint(testExp1, testExp4); Disjoint geomFilter2 = ff.disjoint(testExp2, testExp4); assertTrue(geomFilter1.equals(geomFilter2)); geomFilter2 = ff.disjoint(testExp2, new LiteralExpressionImpl(new Double(45))); assertTrue(!geomFilter1.equals(geomFilter2)); tFilter1 = ff.between(ff.literal(1), ff.literal(-1), ff.literal(3)); assertTrue(!geomFilter1.equals(tFilter1)); } }
public void testToString() throws Exception { FunctionImpl func = new FunctionImpl(); Expression param = new LiteralExpressionImpl(42); func.setName("TestFunction"); func.setParameters(Collections.singletonList(param)); String result = func.toString(); assertEquals("TestFunction([42])", result); }