jline.console.history.History.add()方法的使用及代码示例

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

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

History.add介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

String partial = squeezeStatement(buffer.toString());
if (!partial.isEmpty()) {
  reader.getHistory().add(partial);
reader.getHistory().add(squeezeStatement(split.statement()) + split.terminator());

代码示例来源:origin: jline/jline

history.add(historyLine);

代码示例来源:origin: com.netflix.eureka2/eureka-testkit

private void loadHistory() {
  if (HISTORY_FILE != null && HISTORY_FILE.exists()) {
    try {
      try (LineNumberReader reader = new LineNumberReader(new FileReader(HISTORY_FILE))) {
        History history = consoleReader.getHistory();
        String line;
        while ((line = reader.readLine()) != null) {
          history.add(line);
        }
      }
    } catch (IOException ignored) {
      System.err.println("ERROR: could not load history file from ~/.eureka_history");
    }
  }
}

代码示例来源:origin: com.netflix.eureka/eureka2-testkit

private void loadHistory() {
  if (HISTORY_FILE != null && HISTORY_FILE.exists()) {
    try {
      try (LineNumberReader reader = new LineNumberReader(new FileReader(HISTORY_FILE))) {
        History history = consoleReader.getHistory();
        String line;
        while ((line = reader.readLine()) != null) {
          history.add(line);
        }
      }
    } catch (IOException ignored) {
      System.err.println("ERROR: could not load history file from ~/.eureka_history");
    }
  }
}

代码示例来源:origin: dariober/ASCIIGenome

/**Read the asciigenome history file and put it a list as current history. Or
 * return empty history file does not exist or can't be read. 
 * */
public History getCommandHistory(){
  History cmdHistory= new MemoryHistory();
  for(String x : this.getCommands()){
    cmdHistory.add(x);
  }
  return cmdHistory;
}

代码示例来源:origin: com.typesafe.sbt/incremental-compiler

history.add(historyLine);

代码示例来源:origin: stanford-futuredata/macrobase

reader.getHistory().add(statementStr.replaceAll("\\s+", " ") + ";");
try {
  Statement stmt = parser.createStatement(statementStr);

代码示例来源:origin: prestosql/presto

String partial = squeezeStatement(buffer.toString());
if (!partial.isEmpty()) {
  reader.getHistory().add(partial);
reader.getHistory().add(squeezeStatement(split.statement()) + split.terminator());

代码示例来源:origin: com.facebook.presto/presto-cli

String partial = squeezeStatement(buffer.toString());
if (!partial.isEmpty()) {
  reader.getHistory().add(partial);
reader.getHistory().add(squeezeStatement(split.statement()) + split.terminator());

代码示例来源:origin: io.prestosql/presto-cli

String partial = squeezeStatement(buffer.toString());
if (!partial.isEmpty()) {
  reader.getHistory().add(partial);
reader.getHistory().add(squeezeStatement(split.statement()) + split.terminator());

代码示例来源:origin: dariober/ASCIIGenome

@Test
public void testHistory() throws IOException{
  
  ConsoleReader console= new ConsoleReader();
  //History history= new History(new File(System.getProperty("user.home") + File.separator + ".asciigenome_history"));
  History history= new MemoryHistory();
  history.add("foobar");
  history.add("baz");
  console.setHistory(history);
  System.out.println(console.getHistory());
  console.close();
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-cli

String partial = squeezeStatement(buffer.toString());
if (!partial.isEmpty()) {
  reader.getHistory().add(partial);
reader.getHistory().add(squeezeStatement(split.statement()) + split.terminator());

代码示例来源:origin: eclipse-ee4j/tyrus

console.getHistory().add("open " + args[i]);
console.setPrompt(getPrompt());
i++;

代码示例来源:origin: org.spark-project.hive/hive-beeline

.toByteArray()));
} else {
 consoleReader.getHistory().add(hist.toString());

代码示例来源:origin: com.github.hyukjinkwon/hive-beeline

.toByteArray()));
} else {
 consoleReader.getHistory().add(hist.toString());

代码示例来源:origin: usethesource/rascal

private void handleCommandQueue() throws IOException, InterruptedException {
  boolean handledQueue = false;
  String queuedCommand;
  while ((queuedCommand = commandQueue.poll()) != null) {
    handledQueue = true;
    reader.resetPromptLine(reader.getPrompt(), queuedCommand, 0);
    reader.println();
    reader.getHistory().add(queuedCommand);
    try {
      handlingInput = true;
      handleInput(queuedCommand);
    }
    finally {
      handlingInput = false;
    }
  }
  if (handledQueue) {
    String oldPrompt = reader.getPrompt();
    reader.resetPromptLine("", "", 0);
    reader.setPrompt(oldPrompt);
  }
}

代码示例来源:origin: org.springframework.shell/spring-shell

reader.getHistory().add(logEntry);

相关文章