src/share/classes/com/sun/source/tree/LambdaExpressionTree.java

Fri, 04 Oct 2013 10:00:28 -0700

author
darcy
date
Fri, 04 Oct 2013 10:00:28 -0700
changeset 2083
379c04c090cf
parent 1590
011cf7e0a148
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8025913: Rename jdk.Supported to jdk.Exported
Reviewed-by: psandoz, forax, lancea, alanb, mchung, jjg

mcimadamore@1142 1 /*
darcy@1590 2 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
mcimadamore@1142 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@1142 4 *
mcimadamore@1142 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@1142 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@1142 7 * published by the Free Software Foundation. Oracle designates this
mcimadamore@1142 8 * particular file as subject to the "Classpath" exception as provided
mcimadamore@1142 9 * by Oracle in the LICENSE file that accompanied this code.
mcimadamore@1142 10 *
mcimadamore@1142 11 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@1142 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@1142 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@1142 14 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@1142 15 * accompanied this code).
mcimadamore@1142 16 *
mcimadamore@1142 17 * You should have received a copy of the GNU General Public License version
mcimadamore@1142 18 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@1142 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@1142 20 *
mcimadamore@1142 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mcimadamore@1142 22 * or visit www.oracle.com if you need additional information or have any
mcimadamore@1142 23 * questions.
mcimadamore@1142 24 */
mcimadamore@1142 25
mcimadamore@1142 26 package com.sun.source.tree;
mcimadamore@1142 27
mcimadamore@1142 28 import java.util.List;
mcimadamore@1142 29
mcimadamore@1142 30 /**
mcimadamore@1142 31 * A tree node for a lambda expression.
mcimadamore@1142 32 *
mcimadamore@1142 33 * For example:
jjg@1326 34 * <pre>{@code
mcimadamore@1142 35 * ()->{}
mcimadamore@1142 36 * (List<String> ls)->ls.size()
mcimadamore@1142 37 * (x,y)-> { return x + y; }
jjg@1326 38 * }</pre>
mcimadamore@1142 39 */
darcy@2083 40 @jdk.Exported
mcimadamore@1142 41 public interface LambdaExpressionTree extends ExpressionTree {
mcimadamore@1142 42
mcimadamore@1142 43 /**
mcimadamore@1142 44 * Lambda expressions come in two forms: (i) expression lambdas, whose body
mcimadamore@1142 45 * is an expression, and (ii) statement lambdas, whose body is a block
mcimadamore@1142 46 */
darcy@2083 47 @jdk.Exported
mcimadamore@1142 48 public enum BodyKind {
mcimadamore@1142 49 /** enum constant for expression lambdas */
mcimadamore@1142 50 EXPRESSION,
mcimadamore@1142 51 /** enum constant for statement lambdas */
mcimadamore@1142 52 STATEMENT;
mcimadamore@1142 53 }
mcimadamore@1142 54
mcimadamore@1142 55 List<? extends VariableTree> getParameters();
mcimadamore@1142 56 Tree getBody();
mcimadamore@1142 57 BodyKind getBodyKind();
mcimadamore@1142 58 }

mercurial