src/jdk.compiler/share/classes/com/sun/source/tree/SwitchExpressionTree.java
author rkennke
Fri, 12 Oct 2018 16:25:24 +0200
changeset 52107 0c1e44da019c
parent 51563 de411d537aae
child 54817 ef73702a906e
permissions -rw-r--r--
8212053: A few more missing object equals barriers Reviewed-by: shade, zgu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51563
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
     1
/*
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
     2
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
     4
 *
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    10
 *
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    15
 * accompanied this code).
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    16
 *
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    20
 *
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    23
 * questions.
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    24
 */
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    25
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    26
package com.sun.source.tree;
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    27
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    28
import java.util.List;
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    29
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    30
/**
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    31
 * A tree node for a {@code switch} expression.
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    32
 *
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    33
 * For example:
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    34
 * <pre>
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    35
 *   switch ( <em>expression</em> ) {
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    36
 *     <em>cases</em>
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    37
 *   }
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    38
 * </pre>
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    39
 *
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    40
 * @jls section 15.29
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    41
 *
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    42
 * @since 12
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    43
 *
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    44
 * @deprecated This method is modeling switch expressions,
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    45
 * which are part of a preview feature and may be removed
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    46
 * if the preview feature is removed.
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    47
 */
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    48
@Deprecated(forRemoval=true, since="12")
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    49
public interface SwitchExpressionTree extends ExpressionTree {
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    50
    /**
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    51
     * Returns the expression for the {@code switch} expression.
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    52
     * @return the expression
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    53
     */
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    54
    ExpressionTree getExpression();
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    55
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    56
    /**
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    57
     * Returns the cases for the {@code switch} expression.
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    58
     * @return the cases
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    59
     */
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    60
    List<? extends CaseTree> getCases();
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
diff changeset
    61
}