本文整理了Java中jline.History.<init>()
方法的一些代码示例,展示了History.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。History.<init>()
方法的具体详情如下:
包路径:jline.History
类名称:History
方法名:<init>
暂无
代码示例来源:origin: stackoverflow.com
History history = new History(); // assuming this with no-args
public void playMove() {
int delay = 1200; // delay for 1 sec.
// etc.
// etc.
}
代码示例来源:origin: stackoverflow.com
var history = new History();
var historyTotal = 0;
function historyTest() {
history.happen("toggle", function () {
historyTotal++;
}, function () {
historyTotal--;
});
}
historyTest();
historyTest();
historyTest();
history.undo();
history.undo();
history.redo();
history.undo();
history.redo();
代码示例来源:origin: stackoverflow.com
List<History> list = Arrays.asList(new History("event1"),
new History("event2"),
new History("event1"));
Map<String, List<History>> result = list.stream()
.collect(Collectors.groupingBy(History::getEvent));
代码示例来源:origin: stackoverflow.com
HashMap<String key,History h> map = new HashMap<String key,History h>();
map.put("X",new History());
代码示例来源:origin: stackoverflow.com
var viewModelEmploymentHistory = function () {
// Operations
var self = this;
self.historyList = ko.observableArray([new History()]); // Put one line in by default
self.addHistory = function () { self.historyList.unshift(new History()) }
self.removeHistory = function (history) {
self.historyList.remove(history)
}
self.educationList = ko.observableArray([new Education()]); // Put one line in by default
self.addEducation = function () { self.educationList.unshift(new Education()) };
self.removeEducation = function (education) {
self.educationList.remove(education)}
};
代码示例来源:origin: stackoverflow.com
public static ArrayList<History> getList() {
Cursor cursor = null;
try {
MySQLiteOpenHelper mDbHelper = MySQLiteOpenHelper.getInstance();
SQLiteDatabase db = mDbHelper.getWritableDatabase();
// order by _id desc
String sql = "select * from " + History.TABLE_NAME + " order by _id desc";
ArrayList<History> list = new ArrayList<History>();
cursor = db.rawQuery(sql, null);
if (cursor != null) {
for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
History item = new History();
item.fromCuror(cursor);
list.add(item);
}
}
return list;
} finally {
if (null != cursor && Integer.parseInt(Build.VERSION.SDK) < 14) {
cursor.close();
}
}
}
代码示例来源:origin: stackoverflow.com
public void addItem(Object data) {
History history = new History();
history.getDataHashMap().put("planet", data);
history.addToHistoryDB();
mHistoryList.add(0, history);
mPlanetsList.add(0, history.createPlanet());
if (null != mOnItemAddHandler) {
mOnItemAddHandler.onItemAdded(data);
}
}
代码示例来源:origin: org.apache.jackrabbit.vault/vault-cli
protected void initJLine() {
History history = new History();
/*
try {
history = new History(new File(".consolehistory"));
} catch (IOException e) {
log.warn("Cannot read or write file for storing command line history: " + e.getMessage() + "");
history = new History();
}
*/
reader.setHistory(history);
reader.setUseHistory(true);
setCompletor();
}
代码示例来源:origin: stackoverflow.com
Presence presence = new Presence(Presence.Type.available);
presence.setTo(roomJID);
//Setting MaxStanzas to 0
MUCInitialPresence m = new MUCInitialPresence();
History h = new History();
h.setMaxStanzas(0);
m.setHistory(h);
presence.addExtension(m);
try {
connection.sendStanza(presence);
} catch (NotConnectedException e) {
}
代码示例来源:origin: stackoverflow.com
@Before
public void init() throws Exception{
ListHistoryResponse historyResponse = new ListHistoryResponse();
historyResponse.setHistoryId(BigInteger.valueOf(1234L));
List<History> historyList = new ArrayList<>();
History historyEntry = new History();
Message message = new Message();
message.setId("123456");
message.setThreadId("123456");
List<Message> messages = new ArrayList<>();
messages.add(message);
historyEntry.setMessages(messages);
historyList.add(historyEntry);
mock = mock(Gmail.class);
Gmail.Users users = mock(Gmail.Users.class);
Gmail.Users.History history = mock(Gmail.Users.History.class);
Gmail.Users.History.List list = mock(Gmail.Users.History.List.class);
when(mock.users()).thenReturn(users);
when(users.history()).thenReturn(history);
when(history.list("me")).thenReturn(list);
when(list.setStartHistoryId(BigInteger.valueOf(123L))).thenReturn(list);
when(list.setPageToken(null)).thenReturn(list);
when(list.execute()).thenReturn(historyResponse);
}
代码示例来源:origin: io.snappydata/gemfire-core
private void initJline() throws Exception
{
// String osName = System.getProperty("os.name");
// if (osName.startsWith("Windows")) {
// return;
// }
consoleReader = new ConsoleReader();
consoleReader.setBellEnabled(false);
// consoleReader.setDebug(new java.io.PrintWriter("jline-debug.txt"));
History history = consoleReader.getHistory();
if (history == null) {
history = new History();
consoleReader.setHistory(history);
}
File historyFile = new File(System.getProperty("user.home"), ".gfshhistory");
history.setHistoryFile(historyFile);
// reader.setDebug(new PrintWriter(new FileWriter("writer.debug", true)));
List completors = new LinkedList();
completors.add(new SimpleCompletor(commands));
consoleReader.addCompletor(new ArgumentCompletor(completors));
}
代码示例来源:origin: thinkaurelius/faunus
public Console(final IO io, final String inputPrompt, final String resultPrompt) {
io.out.println();
io.out.println(" \\,,,/");
io.out.println(" (o o)");
io.out.println("-----oOOo-(_)-oOOo-----");
final Groovysh groovy = new Groovysh();
groovy.setResultHook(new NullResultHookClosure(groovy));
for (final String imps : Imports.getImports()) {
groovy.execute("import " + imps);
}
for (final String evs : Imports.getEvaluates()) {
groovy.execute(evs);
}
groovy.setResultHook(new ResultHookClosure(groovy, io, resultPrompt));
groovy.setHistory(new History());
final InteractiveShellRunner runner = new InteractiveShellRunner(groovy, new PromptClosure(groovy, inputPrompt));
runner.setErrorHandler(new ErrorHookClosure(runner, io));
try {
runner.setHistory(new History(new File(System.getProperty("user.home") + "/" + HISTORY_FILE)));
} catch (IOException e) {
io.err.println("Unable to create history file: " + HISTORY_FILE);
}
Gremlin.load();
FaunusGremlin.load();
try {
runner.run();
} catch (Error e) {
//System.err.println(e.getMessage());
}
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
History history = new History(historyFile);
reader.setHistory(history);
代码示例来源:origin: stackoverflow.com
protected void onChatHistory(ArrayList<? extends Parcelable> arrayList) {
ArrayList<History> listHistory = (ArrayList<History>) arrayList;
//chatHistoryList = new ArrayList<History>();// (Remove this line from here)
for (int i = 0; i < listHistory.size(); i++) {
History historyData = new History();
historyData.setFromUser(listHistory.get(i).getFromUser());
historyData.setMsgBody(listHistory.get(i).getMsgBody());
historyData.setMsgTime(listHistory.get(i).getMsgTime());
historyData.setRowId(listHistory.get(i).getRowId());
historyData.setMsgId(listHistory.get(i).getMsgId());
historyData.setToUser(listHistory.get(i).getToUser());
chatHistoryList.add(historyData);
}
progressBar.setVisibility(View.GONE);
progressText.setVisibility(View.GONE);
setValuesInAdapter();
}
代码示例来源:origin: tinkerpop/tinkubator
History history = new History();
history.setHistoryFile(new File(MUTANT_HISTORY));
reader.setHistory(history);
代码示例来源:origin: edu.berkeley.cs.shark/hive-cli
if ((new File(historyDirectory)).exists()) {
String historyFile = historyDirectory + File.separator + HISTORYFILE;
reader.setHistory(new History(new File(historyFile)));
} else {
System.err.println("WARNING: Directory for Hive history file: " + historyDirectory +
代码示例来源:origin: org.netbeans.api/org-jruby
public static void createReadline(Ruby runtime) throws IOException {
ConsoleHolder holder = new ConsoleHolder();
holder.history = new History();
holder.currentCompletor = null;
RubyModule mReadline = runtime.defineModule("Readline");
mReadline.dataWrapStruct(holder);
mReadline.defineAnnotatedMethods(Readline.class);
IRubyObject hist = runtime.getObject().callMethod(runtime.getCurrentContext(), "new");
mReadline.fastSetConstant("HISTORY", hist);
hist.getSingletonClass().includeModule(runtime.getEnumerable());
hist.getSingletonClass().defineAnnotatedMethods(HistoryMethods.class);
// MRI does similar thing on MacOS X with 'EditLine wrapper'.
mReadline.fastSetConstant("VERSION", runtime.newString("JLine wrapper"));
}
内容来源于网络,如有侵权,请联系作者删除!