本文整理了Java中jline.console.history.History.get()
方法的一些代码示例,展示了History.get()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。History.get()
方法的具体详情如下:
包路径:jline.console.history.History
类名称:History
方法名:get
暂无
代码示例来源:origin: prestodb/presto
continue;
line = history.get(historyIndex - 1).toString();
System.out.println(commandPrompt + line);
代码示例来源:origin: jline/jline
rep = history.get(history.index() - 1).toString();
break;
case '#':
throw new IllegalArgumentException("!?" + sc + ": event not found");
} else {
rep = history.get(idx).toString();
String previous = history.get(history.index() - 1).toString().trim();
int lastSpace = previous.lastIndexOf(' ');
if(lastSpace != -1) {
rep = (history.get(history.index() - idx)).toString();
} else {
throw new IllegalArgumentException((neg ? "!-" : "!") + str.substring(i1, i) + ": event not found");
rep = (history.get(idx - 1)).toString();
} else {
throw new IllegalArgumentException((neg ? "!-" : "!") + str.substring(i1, i) + ": event not found");
throw new IllegalArgumentException("!" + ss + ": event not found");
} else {
rep = history.get(idx).toString();
String s1 = str.substring(i + 1, i1);
String s2 = str.substring(i1 + 1, i2);
String s = history.get(history.index() - 1).toString().replace(s1, s2);
sb.append(s);
i = i2 + 1;
代码示例来源:origin: jline/jline
/**
* Possible states in which the current readline operation may be in.
*/
private static enum State {
/**
* The user is just typing away
*/
NORMAL,
/**
* In the middle of a emacs seach
*/
SEARCH,
FORWARD_SEARCH,
/**
* VI "yank-to" operation ("y" during move mode)
*/
VI_YANK_TO,
/**
* VI "delete-to" operation ("d" during move mode)
*/
VI_DELETE_TO,
/**
* VI "change-to" operation ("c" during move mode)
*/
VI_CHANGE_TO
}
代码示例来源:origin: jline/jline
if (history.get(i).toString().contains(searchTerm)) {
idx = i;
break;
if (history.get(i).toString().contains(searchTerm)) {
idx = i;
break;
putString(history.get(idx));
setCursorPosition(0);
flush();
if (forward) {
for (int i = idx+1; !isMatch && i < end; i++) {
if (history.get(i).toString().contains(searchTerm)) {
idx = i;
isMatch = true;
if (history.get(i).toString().contains(searchTerm)) {
idx = i;
isMatch = true;
setCursorPosition(0);
killLine();
putString(history.get(idx));
setCursorPosition(0);
代码示例来源:origin: com.netflix.eureka/eureka2-testkit
@Override
protected boolean executeCommand(Context context, String[] args) {
for (int i = 0; i < consoleReader.getHistory().size(); i++) {
System.out.println(String.format("%4d %s", i + 1, consoleReader.getHistory().get(i)));
}
return true;
}
}
代码示例来源:origin: com.netflix.eureka2/eureka-testkit
@Override
protected boolean executeCommand(Context context, String[] args) {
for (int i = 0; i < consoleReader.getHistory().size(); i++) {
System.out.println(String.format("%4d %s", i + 1, consoleReader.getHistory().get(i)));
}
return true;
}
}
代码示例来源:origin: com.typesafe.sbt/incremental-compiler
rep = history.get(history.index() - 1).toString();
break;
case '#':
throw new IllegalArgumentException("!?" + sc + ": event not found");
} else {
rep = history.get(idx).toString();
String previous = history.get(history.index() - 1).toString().trim();
int lastSpace = previous.lastIndexOf(' ');
if(lastSpace != -1) {
rep = (history.get(history.index() - idx)).toString();
} else {
throw new IllegalArgumentException((neg ? "!-" : "!") + str.substring(i1, i) + ": event not found");
rep = (history.get(idx - 1)).toString();
} else {
throw new IllegalArgumentException((neg ? "!-" : "!") + str.substring(i1, i) + ": event not found");
throw new IllegalArgumentException("!" + ss + ": event not found");
} else {
rep = history.get(idx).toString();
String s1 = str.substring(i + 1, i1);
String s2 = str.substring(i1 + 1, i2);
String s = history.get(history.index() - 1).toString().replace(s1, s2);
sb.append(s);
i = i2 + 1;
代码示例来源:origin: prestosql/presto
continue;
line = history.get(historyIndex - 1).toString();
System.out.println(commandPrompt + line);
代码示例来源:origin: com.facebook.presto/presto-cli
continue;
line = history.get(historyIndex - 1).toString();
System.out.println(commandPrompt + line);
代码示例来源:origin: io.prestosql/presto-cli
continue;
line = history.get(historyIndex - 1).toString();
System.out.println(commandPrompt + line);
代码示例来源:origin: uk.co.nichesolutions.presto/presto-cli
continue;
line = history.get(historyIndex - 1).toString();
System.out.println(commandPrompt + line);
代码示例来源:origin: com.typesafe.sbt/incremental-compiler
/**
* Possible states in which the current readline operation may be in.
*/
private static enum State {
/**
* The user is just typing away
*/
NORMAL,
/**
* In the middle of a emacs seach
*/
SEARCH,
FORWARD_SEARCH,
/**
* VI "yank-to" operation ("y" during move mode)
*/
VI_YANK_TO,
/**
* VI "delete-to" operation ("d" during move mode)
*/
VI_DELETE_TO,
/**
* VI "change-to" operation ("c" during move mode)
*/
VI_CHANGE_TO
}
代码示例来源:origin: com.typesafe.sbt/incremental-compiler
if (history.get(i).toString().contains(searchTerm)) {
idx = i;
break;
if (history.get(i).toString().contains(searchTerm)) {
idx = i;
break;
putString(history.get(idx));
setCursorPosition(0);
flush();
if (forward) {
for (int i = idx+1; !isMatch && i < end; i++) {
if (history.get(i).toString().contains(searchTerm)) {
idx = i;
isMatch = true;
if (history.get(i).toString().contains(searchTerm)) {
idx = i;
isMatch = true;
setCursorPosition(0);
killLine();
putString(history.get(idx));
setCursorPosition(0);
内容来源于网络,如有侵权,请联系作者删除!