@Test public void testMult() { BundleFilterNum bfn = new BundleFilterNum("c0,n3,*,v1,set", null); Bundle bundle = new ListBundle(); bundle.setValue(bundle.getFormat().getField("c0"), ValueFactory.create(3)); bundle.setValue(bundle.getFormat().getField("c1"), ValueFactory.create(4)); bfn.filter(bundle); assertEquals("9", bundle.getValue(bundle.getFormat().getField("c1")).toString()); }
@Override public boolean filter(Bundle bundle) { if (columns == null) { return calculator.calculate(bundle) != null; } else { Bundle alt = makeAltBundle(bundle); boolean res = calculator.calculate(alt) != null; mergeBundles(bundle, alt); return res; } }
BundleFilterNum implements BundleFilter { @Override public boolean filter(Bundle bundle) { if (columns == null) { return calculator.calculate(bundle) != null; } else { Bundle alt = makeAltBundle(bundle); boolean res = calculator.calculate(alt) != null; mergeBundles(bundle, alt); return res; } } }
BundleFilterNum implements BundleFilter { @Override public boolean filter(Bundle bundle) { if (columns == null) { return calculator.calculate(bundle) != null; } else { Bundle alt = makeAltBundle(bundle); boolean res = calculator.calculate(alt) != null; mergeBundles(bundle, alt); return res; } } @JsonCreator  BundleFilterNum(@JsonProperty(value = "define", required = true) String define,
                           @JsonProperty("columns") String[] columns); }
BundleFilterNum implements BundleFilter { @Override public boolean filter(Bundle bundle) { if (columns == null) { return calculator.calculate(bundle) != null; } else { Bundle alt = makeAltBundle(bundle); boolean res = calculator.calculate(alt) != null; mergeBundles(bundle, alt); return res; } } @JsonCreator  BundleFilterNum(@JsonProperty(value = "define", required = true) String define,
                           @JsonProperty("columns") String[] columns); @Override boolean filter(Bundle bundle); }
BundleFilterNum implements BundleFilter { @Override public boolean filter(Bundle bundle) { if (columns == null) { return calculator.calculate(bundle) != null; } else { Bundle alt = makeAltBundle(bundle); boolean res = calculator.calculate(alt) != null; mergeBundles(bundle, alt); return res; } } @JsonCreator  BundleFilterNum(@JsonProperty(value = "define", required = true) String define,
                           @JsonProperty("columns") String[] columns); @Override boolean filter(Bundle bundle);  }