diff options
Diffstat (limited to 'tutorials/java/src/phpdbg/ui/History.java')
-rw-r--r-- | tutorials/java/src/phpdbg/ui/History.java | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/tutorials/java/src/phpdbg/ui/History.java b/tutorials/java/src/phpdbg/ui/History.java deleted file mode 100644 index 2950087ef8..0000000000 --- a/tutorials/java/src/phpdbg/ui/History.java +++ /dev/null @@ -1,49 +0,0 @@ -package phpdbg.ui; - - -import java.util.ArrayList; - -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/** - * Implement a simple history list for command input - * @author krakjoe - */ -public class History extends ArrayList<String> { - private Integer position = new Integer(0); - - public History() { - super(); - } - - @Override public boolean add(String text) { - String last = last(); - if (text != null) { - if (last == null || !last.equals(text)) { - if (super.add(text)) { - position = size(); - return true; - } - } - } - return false; - } - - public String last() { - if (position >= 1) { - position--; - return get(position); - } else return new String(); - } - - public String next() { - if (position+1 < size()) { - position++; - return get(position); - } else return new String(); - } -}
\ No newline at end of file |