@Test public void splitFunction() throws Exception { Function input = new StringLiteralFunction("abc"); Pattern p = Pattern.compile("b"); Function f = new SplitFunction(input, p, 0); assertEquals(0, f.parameters().length); assertEquals("a", f.getString(null)); assertFalse(f.getBoolean(null)); Collection<String> dialogFunctions = new ArrayList<>(); f.getFunctionDialogReferences(dialogFunctions); assertTrue(dialogFunctions.isEmpty()); f = new SplitFunction(new StringLiteralFunction(FunctionLibrary.ERROR), p, 0); assertEquals(FunctionLibrary.ERROR, f.getString(null)); f = new SplitFunction(input, p, -1); assertEquals(0, f.parameters().length); assertEquals("", f.getString(null)); f = new SplitFunction(input, p, 10); assertEquals(0, f.parameters().length); assertEquals("", f.getString(null)); }
public SplitFunction(Function input, Pattern p, int idx) { this.regex = p.toString(); this.input = input; this.index = idx; this.params = input.parameters(); }
SplitFunction implements Function { public SplitFunction(Function input, Pattern p, int idx) { this.regex = p.toString(); this.input = input; this.index = idx; this.params = input.parameters(); } }
SplitFunction implements Function { public SplitFunction(Function input, Pattern p, int idx) { this.regex = p.toString(); this.input = input; this.index = idx; this.params = input.parameters(); } SplitFunction(Function input, Pattern p, int idx); }
SplitFunction implements Function { public SplitFunction(Function input, Pattern p, int idx) { this.regex = p.toString(); this.input = input; this.index = idx; this.params = input.parameters(); } SplitFunction(Function input, Pattern p, int idx); @Override String getString(Values parameters); @Override String[] parameters(); @Override void getFunctionDialogReferences(Collection<String> set); @Override boolean getBoolean(Values parameters); }
SplitFunction implements Function { public SplitFunction(Function input, Pattern p, int idx) { this.regex = p.toString(); this.input = input; this.index = idx; this.params = input.parameters(); } SplitFunction(Function input, Pattern p, int idx); @Override String getString(Values parameters); @Override String[] parameters(); @Override void getFunctionDialogReferences(Collection<String> set); @Override boolean getBoolean(Values parameters);  }