private void add(EditItem item){
  while (mmHistory.size() > mmPosition) {
    mmHistory.removeLast();
  }
  mmHistory.add(item);
  mmPosition++;
  if (mmMaxHistorySize >= 0) {
    trimHistory();
  }
}

private void add ( EditItem item ) { while ( mmHistory . size ( ) > mmPosition ) { mmHistory . removeLast ( ) ; } mmHistory . add ( item ) ; mmPosition ++ ; if ( mmMaxHistorySize >= 0 ) { trimHistory ( ) ; } }
adds a new edit operation to the history at the current position . if executed after a call to getprevious ( ) removes all the future history ( elements with positions > = current history position ) .
