if (myHistory.size() >= myMaxHistorySize) {
myHistory.removeLast();
}
- else {
- myHistory.addFirst(statement);
- }
+ myHistory.addFirst(statement);
}
}
public void removeFromHistory(final String statement) {
synchronized (myHistory) {
- myModificationTracker ++;
+ myModificationTracker++;
myHistoryCursor = -1;
myHistory.remove(statement);
}
@Nullable
public String getHistoryNext() {
synchronized (myHistory) {
- if (myHistoryCursor < myHistory.size()-1) {
+ if (myHistoryCursor < myHistory.size() - 1) {
return myHistory.get(++myHistoryCursor);
}
else {
public boolean hasHistory(final boolean next) {
synchronized (myHistory) {
- return next? myHistoryCursor <= myHistory.size() - 1 : myHistoryCursor >= 0;
+ return next ? myHistoryCursor <= myHistory.size() - 1 : myHistoryCursor >= 0;
}
}