Public Methods | |
| HistoryList () | |
| void | add (String in) |
| String | getPrevious () |
| String | getNext () |
|
|
00022 {
00023 _list = new Vector();
00024 _pos = -1;
00025 _sel = null;
00026 }
|
|
|
00030 {
00031 if(in.length() > 0) {
00032 String last = (_list.size() > 0)? ""+_list.lastElement() : null;
00033 if(!in.equals(last))
00034 _list.add(in);
00035 }
00036
00037 if(!in.equals(_sel)) // a new one
00038 _pos = _list.size()-1;
00039
00040 _sel = null;
00041 }
|
|
|
00044 {
00045 if(_list.size() == 0) return null;
00046
00047 //decrement pos unless it is the first time (_sel == nul)
00048 if((_sel != null) && (_pos > 0)) _pos--;
00049
00050 _sel = _list.elementAt(_pos).toString();
00051 return _sel;
00052 }
|
|
|
00055 {
00056 if(_list.size() == 0) return null;
00057
00058 if(_pos < _list.size() - 1) _pos++;
00059
00060 _sel = _list.elementAt(_pos).toString();
00061 return _sel;
00062 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001