Package com.google.refine.history
Class History
java.lang.Object
com.google.refine.history.History
Track done and undone changes. Done changes can be undone; undone changes can be redone. Each change is actually not
tracked directly but through a history entry. The history entry stores only the metadata, while the change object
stores the actual data, thus the history entries are much smaller and can be kept in memory, while the change objects
are only loaded into memory on demand.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<HistoryEntry>protected List<HistoryEntry>protected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntry(HistoryEntry entry) Adds a HistoryEntry to the list of past histories Adding a new entry clears all currently held future historiesgetChangeClass(String className) protected HistoryEntrygetEntry(long entryID) getLastPastEntries(int count) longgetPrecedingEntryID(long entryID) voidload(Project project, LineNumberReader reader) static ChangereadOneChange(InputStream in, Pool pool) static ChangereadOneChange(LineNumberReader reader, Pool pool) protected voidredo(int times) voidsave(Writer writer, Properties options) protected voidprotected voidundo(int times) voidundoRedo(long lastDoneEntryID) static voidwriteOneChange(OutputStream out, Change change, Pool pool) static voidwriteOneChange(Writer writer, Change change, Pool pool) static voidwriteOneChange(Writer writer, Change change, Properties options)
-
Field Details
-
_projectID
protected long _projectID -
_pastEntries
-
_futureEntries
-
-
Constructor Details
-
History
-
-
Method Details
-
readOneChange
- Throws:
Exception
-
readOneChange
- Throws:
Exception
-
writeOneChange
- Throws:
IOException
-
writeOneChange
- Throws:
IOException
-
writeOneChange
public static void writeOneChange(Writer writer, Change change, Properties options) throws IOException - Throws:
IOException
-
getChangeClass
public static Class<? extends Change> getChangeClass(String className) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
addEntry
Adds a HistoryEntry to the list of past histories Adding a new entry clears all currently held future histories- Parameters:
entry-
-
setModified
protected void setModified() -
getLastPastEntries
-
undoRedo
public void undoRedo(long lastDoneEntryID) -
getPrecedingEntryID
public long getPrecedingEntryID(long entryID) -
getEntry
-
undo
protected void undo(int times) -
redo
protected void redo(int times) -
save
- Throws:
IOException
-
load
- Throws:
IOException
-