History history = new History(); // assuming this with no-args public void playMove() { int delay = 1200; // delay for 1 sec. // etc. // etc. }
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();
HashMap<String key,History h> map = new HashMap<String key,History h>(); map.put("X",new History());
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)} };
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(); } } }
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); } }
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(); }
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) { }
@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); }
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)); }
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()); } }
History history = new History(historyFile); reader.setHistory(history);
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(); }
History history = new History(); history.setHistoryFile(new File(MUTANT_HISTORY)); reader.setHistory(history);
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 +
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")); }