Snippet (Java SE 15 & JDK 15) (original) (raw)

Direct Known Subclasses:

[ErroneousSnippet](ErroneousSnippet.html "class in jdk.jshell"), [ExpressionSnippet](ExpressionSnippet.html "class in jdk.jshell"), [PersistentSnippet](PersistentSnippet.html "class in jdk.jshell"), [StatementSnippet](StatementSnippet.html "class in jdk.jshell")


public abstract class Snippet extends Object

A Snippet represents a snippet of Java source code as passed toJShell.eval(java.lang.String). It is associated only with theJShell instance that created it. An instance of Snippet (including its subclasses) is immutable: an access to any of its methods will always return the same result. For information about the current state of the snippet within the JShell state engine, query JShell passing the Snippet.

Because it is immutable, Snippet (and subclasses) is thread-safe.

Since:

9

See Also:

JShell.status(jdk.jshell.Snippet)

Nested Classes

Modifier and Type Class Description
static class Snippet.Kind Describes the general kind of snippet.
static class Snippet.Status Describes the current state of a Snippet.
static class Snippet.SubKind The detailed variety of a snippet.

Methods declared in class java.lang.Object

[clone](../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../java.base/java/lang/Object.html#wait%28long,int%29)