@Test public void testValidateInputError() throws Exception { Function f = new Function("f", Type.INT, Type.BOOL); assertFalse(f.validateInput(Variable.create(Type.BOOL, "v", null))); assertFalse(f.validateInput(Variable.create(Type.INT, "v", null), Variable.create(Type.BOOL, "w", null))); }
public final boolean validateInput(final Variable ... input) { final Type[] args = this.getArgTypes(); if (args.length == input.length) { for (int i = 0; i < args.length; i++) { if (!args[i].worksWith(input[i].getType())) { return false; } } return true; } return false; }
Function extends Element implements TypedElement { public final boolean validateInput(final Variable ... input) { final Type[] args = this.getArgTypes(); if (args.length == input.length) { for (int i = 0; i < args.length; i++) { if (!args[i].worksWith(input[i].getType())) { return false; } } return true; } return false; } }
Function extends Element implements TypedElement { public final boolean validateInput(final Variable ... input) { final Type[] args = this.getArgTypes(); if (args.length == input.length) { for (int i = 0; i < args.length; i++) { if (!args[i].worksWith(input[i].getType())) { return false; } } return true; } return false; } Function(final String id, final Type... args); }
Function extends Element implements TypedElement { public final boolean validateInput(final Variable ... input) { final Type[] args = this.getArgTypes(); if (args.length == input.length) { for (int i = 0; i < args.length; i++) { if (!args[i].worksWith(input[i].getType())) { return false; } } return true; } return false; } Function(final String id, final Type... args); final String getId(); final OperationSequence getBody(); final boolean validateInput(final Variable ... input); final Variable[] getVariables(); final Type[] getArgTypes(); final Type getType(); @Override final String toString(); }
Function extends Element implements TypedElement { public final boolean validateInput(final Variable ... input) { final Type[] args = this.getArgTypes(); if (args.length == input.length) { for (int i = 0; i < args.length; i++) { if (!args[i].worksWith(input[i].getType())) { return false; } } return true; } return false; } Function(final String id, final Type... args); final String getId(); final OperationSequence getBody(); final boolean validateInput(final Variable ... input); final Variable[] getVariables(); final Type[] getArgTypes(); final Type getType(); @Override final String toString();  }