org.eclipse.xtext.xbase.lib.Functions Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2010 itemis AG (http://www.itemis.eu) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.xtext.xbase.lib;
import com.google.common.annotations.GwtCompatible;
/**
* This class serves as a container for the various function types that are used to implement the type of closures in
* Xbase.
*
* @author Sebastian Zarnekow - Initial contribution and API
* @see FunctionExtensions
* @see Procedures
*/
@GwtCompatible public interface Functions {
/**
* A function without any parameters.
*
* @param
* the result of the single closure {@link #apply() method}.
*/
interface Function0 {
Result apply();
}
/**
* A function that takes one argument.
*
* @param
* the only argument that is passed to the {@link #apply(Object) closure}
* @param
* the result of the single closure {@link #apply(Object) method}.
*/
interface Function1 {
Result apply(Param p);
}
/**
* A function that takes two arguments.
*
* @param
* the first argument that is passed to the {@link #apply(Object, Object) closure}
* @param
* the second argument that is passed to the {@link #apply(Object, Object) closure}
* @param
* the result of the single closure {@link #apply(Object, Object) method}.
*/
interface Function2 {
Result apply(P1 p1, P2 p2);
}
/**
* A function that takes three arguments.
*
* @param
* the first argument that is passed to the {@link #apply(Object, Object, Object) closure}
* @param
* the second argument that is passed to the {@link #apply(Object, Object, Object) closure}
* @param
* the third argument that is passed to the {@link #apply(Object, Object, Object) closure}
* @param
* the result of the single closure {@link #apply(Object, Object, Object) method}.
*/
interface Function3 {
Result apply(P1 p1, P2 p2, P3 p3);
}
/**
* A function that takes four arguments.
*
* @param
* the first argument that is passed to the {@link #apply(Object, Object, Object, Object) closure}
* @param
* the second argument that is passed to the {@link #apply(Object, Object, Object, Object) closure}
* @param
* the third argument that is passed to the {@link #apply(Object, Object, Object, Object) closure}
* @param
* the fourth argument that is passed to the {@link #apply(Object, Object, Object, Object) closure}
* @param
* the result of the single closure {@link #apply(Object, Object, Object, Object) method}.
*/
interface Function4 {
Result apply(P1 p1, P2 p2, P3 p3, P4 p4);
}
/**
* A function that takes five arguments.
*
* @param
* the first argument that is passed to the {@link #apply(Object, Object, Object, Object, Object)
* closure}
* @param
* the second argument that is passed to the {@link #apply(Object, Object, Object, Object, Object)
* closure}
* @param
* the third argument that is passed to the {@link #apply(Object, Object, Object, Object, Object)
* closure}
* @param
* the fourth argument that is passed to the {@link #apply(Object, Object, Object, Object, Object)
* closure}
* @param
* the fifth argument that is passed to the {@link #apply(Object, Object, Object, Object, Object)
* closure}
* @param
* the result of the single closure {@link #apply(Object, Object, Object, Object, Object) method}.
*/
interface Function5 {
Result apply(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5);
}
/**
* A function that takes six arguments.
*
* @param
* the first argument that is passed to the
* {@link #apply(Object, Object, Object, Object, Object, Object) closure}
* @param
* the second argument that is passed to the
* {@link #apply(Object, Object, Object, Object, Object, Object) closure}
* @param
* the third argument that is passed to the
* {@link #apply(Object, Object, Object, Object, Object, Object) closure}
* @param
* the fourth argument that is passed to the
* {@link #apply(Object, Object, Object, Object, Object, Object) closure}
* @param
* the fifth argument that is passed to the
* {@link #apply(Object, Object, Object, Object, Object, Object) closure}
* @param
* the sixth argument that is passed to the
* {@link #apply(Object, Object, Object, Object, Object, Object) closure}
* @param
* the result of the single closure {@link #apply(Object, Object, Object, Object, Object, Object) method}
* .
*/
interface Function6 {
Result apply(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy