Enum Snippet.SubKind

All Implemented Interfaces:
Serializable, Comparable<Snippet.SubKind>
Enclosing class:
Snippet
public static enum Snippet.SubKind
extends Enum<Snippet.SubKind>

The detailed variety of a snippet. This is a sub-classification of the Kind. The Kind of a SubKind is accessible with kind().

Enum Constants

Enum Constant Description
ANNOTATION_TYPE_SUBKIND

An annotation interface declaration.

ASSIGNMENT_SUBKIND

An assignment expression.

CLASS_SUBKIND

A class declaration.

ENUM_SUBKIND

An enum declaration.

INTERFACE_SUBKIND

An interface declaration.

METHOD_SUBKIND

A method.

OTHER_EXPRESSION_SUBKIND

An expression which has not been wrapped in a temporary variable (reserved).

SINGLE_STATIC_IMPORT_SUBKIND

Single-Static-Import Declaration.

SINGLE_TYPE_IMPORT_SUBKIND

Single-Type-Import Declaration.

STATEMENT_SUBKIND

A statement.

STATIC_IMPORT_ON_DEMAND_SUBKIND

Static-Import-on-Demand Declaration.

TEMP_VAR_EXPRESSION_SUBKIND

An expression whose value has been stored in a temporary variable.

TYPE_IMPORT_ON_DEMAND_SUBKIND

Type-Import-on-Demand Declaration.

UNKNOWN_SUBKIND

An unknown snippet.

VAR_DECLARATION_SUBKIND

A variable declaration without initializer.

VAR_DECLARATION_WITH_INITIALIZER_SUBKIND

A variable declaration with an initializer expression.

VAR_VALUE_SUBKIND

A simple variable reference expression.

Methods

Modifier and Type Method Description
boolean hasValue()

Indicates whether this SubKind is executable and is non-void.

boolean isExecutable()

Indicates whether this SubKind is executable.

Snippet.Kind kind()

The Snippet.Kind that corresponds to this SubKind.

static Snippet.SubKind valueOf​(String name)

Returns the enum constant of this type with the specified name.

static Snippet.SubKind[] values()

Returns an array containing the constants of this enum type, in the order they are declared.

Methods declared in class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods declared in class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constants

SINGLE_TYPE_IMPORT_SUBKIND

public static final Snippet.SubKind SINGLE_TYPE_IMPORT_SUBKIND

Single-Type-Import Declaration. An import declaration of a single type.

TYPE_IMPORT_ON_DEMAND_SUBKIND

public static final Snippet.SubKind TYPE_IMPORT_ON_DEMAND_SUBKIND

Type-Import-on-Demand Declaration. A non-static "star" import.

SINGLE_STATIC_IMPORT_SUBKIND

public static final Snippet.SubKind SINGLE_STATIC_IMPORT_SUBKIND

Single-Static-Import Declaration. An import of a static member.

STATIC_IMPORT_ON_DEMAND_SUBKIND

public static final Snippet.SubKind STATIC_IMPORT_ON_DEMAND_SUBKIND

Static-Import-on-Demand Declaration. A static "star" import of all static members of a named type.

CLASS_SUBKIND

public static final Snippet.SubKind CLASS_SUBKIND

A class declaration. A SubKind of Snippet.Kind.TYPE_DECL.

INTERFACE_SUBKIND

public static final Snippet.SubKind INTERFACE_SUBKIND

An interface declaration. A SubKind of Snippet.Kind.TYPE_DECL.

ENUM_SUBKIND

public static final Snippet.SubKind ENUM_SUBKIND

An enum declaration. A SubKind of Snippet.Kind.TYPE_DECL.

ANNOTATION_TYPE_SUBKIND

public static final Snippet.SubKind ANNOTATION_TYPE_SUBKIND

An annotation interface declaration. A SubKind of Snippet.Kind.TYPE_DECL.

METHOD_SUBKIND

public static final Snippet.SubKind METHOD_SUBKIND

A method. The only SubKind for Snippet.Kind.METHOD.

VAR_DECLARATION_SUBKIND

public static final Snippet.SubKind VAR_DECLARATION_SUBKIND

A variable declaration without initializer. A SubKind of Snippet.Kind.VAR.

VAR_DECLARATION_WITH_INITIALIZER_SUBKIND

public static final Snippet.SubKind VAR_DECLARATION_WITH_INITIALIZER_SUBKIND

A variable declaration with an initializer expression. A SubKind of Snippet.Kind.VAR.

TEMP_VAR_EXPRESSION_SUBKIND

public static final Snippet.SubKind TEMP_VAR_EXPRESSION_SUBKIND

An expression whose value has been stored in a temporary variable. A SubKind of Snippet.Kind.VAR.

VAR_VALUE_SUBKIND

public static final Snippet.SubKind VAR_VALUE_SUBKIND

A simple variable reference expression. A SubKind of Snippet.Kind.EXPRESSION.

ASSIGNMENT_SUBKIND

public static final Snippet.SubKind ASSIGNMENT_SUBKIND

An assignment expression. A SubKind of Snippet.Kind.EXPRESSION.

OTHER_EXPRESSION_SUBKIND

public static final Snippet.SubKind OTHER_EXPRESSION_SUBKIND

An expression which has not been wrapped in a temporary variable (reserved). A SubKind of Snippet.Kind.EXPRESSION.

STATEMENT_SUBKIND

public static final Snippet.SubKind STATEMENT_SUBKIND

A statement. The only SubKind for Snippet.Kind.STATEMENT.

UNKNOWN_SUBKIND

public static final Snippet.SubKind UNKNOWN_SUBKIND

An unknown snippet. The only SubKind for Snippet.Kind.ERRONEOUS.

Methods

values

public static Snippet.SubKind[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

for (Snippet.SubKind c : Snippet.SubKind.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Snippet.SubKind valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

isExecutable

public boolean isExecutable()

Indicates whether this SubKind is executable.

Returns:
true if this SubKind can be executed; otherwise false

hasValue

public boolean hasValue()

Indicates whether this SubKind is executable and is non-void.

Returns:
true if this SubKind has a value; otherwise false

kind

public Snippet.Kind kind()

The Snippet.Kind that corresponds to this SubKind.

Returns:
the fixed Kind for this SubKind

© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/jdk.jshell/jdk/jshell/Snippet.SubKind.html