![JAR search and dependency download from the Maven repository](/logo.png)
org.btrplace.safeplace.spec.term.func.Function Maven / Gradle / Ivy
/*
* Copyright (c) 2016 University Nice Sophia Antipolis
*
* This file is part of btrplace.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
package org.btrplace.safeplace.spec.term.func;
import org.btrplace.safeplace.spec.term.Term;
import org.btrplace.safeplace.spec.type.Type;
import org.btrplace.safeplace.testing.verification.spec.Context;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public interface Function {
Type type();
String id();
T eval(Context mo, Object... args);
Type[] signature();
default Type type(@SuppressWarnings("unused") List args) { return type();}
static String toString(Function f) {
return Arrays.stream(f.signature()).map(Type::toString).collect(Collectors.joining(",",f.id() + "(",")"));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy