jline.History.addToHistory()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中jline.History.addToHistory()方法的一些代码示例,展示了History.addToHistory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。History.addToHistory()方法的具体详情如下:
包路径:jline.History
类名称:History
方法名:addToHistory

History.addToHistory介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-roo

reader.getHistory().addToHistory(logEntry);

代码示例来源:origin: io.snappydata/gemfire-core

@Override
public void addToHistory(String buffer) {
 if (isAutoFlush()) {
  super.addToHistory(toHistoryLoggable(buffer));
 }
}

代码示例来源:origin: org.apache.jackrabbit.vault/vault-cli

continue;
reader.getHistory().addToHistory(oldLine);
System.out.println("Executing '" + oldLine + "'");
line = oldLine;

代码示例来源:origin: org.springframework.roo/org.springframework.roo.shell.jline

reader.getHistory().addToHistory(logEntry);

代码示例来源:origin: org.netbeans.api/org-jruby

@JRubyMethod(name = {"push", "<<"}, rest = true)
public static IRubyObject s_push(IRubyObject recv, IRubyObject[] lines) throws Exception {
  ConsoleHolder holder = getHolder(recv.getRuntime());
  for (int i = 0; i < lines.length; i++) {
    RubyString line = lines[i].convertToString();
    holder.history.addToHistory(line.getUnicodeValue());
  }
  return recv.getRuntime().getNil();
}

代码示例来源:origin: org.netbeans.api/org-jruby

@JRubyMethod(name = "readline", module = true, visibility = Visibility.PRIVATE)
public static IRubyObject s_readline(IRubyObject recv, IRubyObject prompt, IRubyObject add_to_hist) throws IOException {
  ConsoleHolder holder = getHolder(recv.getRuntime());
  if (holder.readline == null) {
    initReadline(recv.getRuntime(), holder); // not overridden, let's go
  }
  IRubyObject line = recv.getRuntime().getNil();
  holder.readline.getTerminal().disableEcho();
  String v = holder.readline.readLine(prompt.toString());
  holder.readline.getTerminal().enableEcho();
  if (null != v) {
    if (add_to_hist.isTrue()) {
      holder.readline.getHistory().addToHistory(v);
    }
    line = recv.getRuntime().newString(v);
  }
  return line;
}

相关文章