Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.internal.le.jmod - Internal Line Editing Module
JDK 17 jdk.internal.le.jmod is the JMOD file for JDK 17 Internal Line Editing module.
JDK 17 Internal Line Editing module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.internal.le.jmod.
JDK 17 Internal Line Editing module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Internal Line Editing module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.internal.le.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/internal/org/jline/reader/impl/UndoTree.java
/*
* Copyright (c) 2002-2016, the original author or authors.
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.reader.impl;
import java.util.function.Consumer;
/**
* Simple undo tree.
* Note that the first added state can't be undone
*/
public class UndoTree<T> {
private final Consumer<T> state;
private final Node parent;
private Node current;
public UndoTree(Consumer<T> s) {
state = s;
parent = new Node(null);
parent.left = parent;
clear();
}
public void clear() {
current = parent;
}
public void newState(T state) {
Node node = new Node(state);
current.right = node;
node.left = current;
current = node;
}
public boolean canUndo() {
return current.left != parent;
}
public boolean canRedo() {
return current.right != null;
}
public void undo() {
if (!canUndo()) {
throw new IllegalStateException("Cannot undo.");
}
current = current.left;
state.accept(current.state);
}
public void redo() {
if (!canRedo()) {
throw new IllegalStateException("Cannot redo.");
}
current = current.right;
state.accept(current.state);
}
private class Node {
private final T state;
private Node left = null;
private Node right = null;
public Node(T s) {
state = s;
}
}
}
⏎ jdk/internal/org/jline/reader/impl/UndoTree.java
Or download all of them as a single archive file:
File name: jdk.internal.le-17.0.5-src.zip File size: 231458 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.internal.opt.jmod - Internal Opt Module
⇐ JDK 17 jdk.internal.jvmstat.jmod - Internal JVM Stat Module
2023-08-25, ≈40🔥, 0💬
Popular Posts:
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
JDK 11 java.security.jgss.jmod is the JMOD file for JDK 11 Security JGSS (Java Generic Security Serv...
JDK 11 jdk.charsets.jmod is the JMOD file for JDK 11 Charsets module. JDK 11 Charsets module compile...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...
What JAR files are required to run sax\Counter.java provided in the Apache Xerces package? You can f...