diff options
author | krakjoe <joe.watkins@live.co.uk> | 2013-11-29 09:19:08 +0000 |
---|---|---|
committer | krakjoe <joe.watkins@live.co.uk> | 2013-11-29 09:19:08 +0000 |
commit | bd49a0f1444885c1724b5322ab786ae634e2222a (patch) | |
tree | dca109f58c938bc64400fdb3b4426850b28f5a70 /tutorials/java/src/phpdbg/ui/History.java | |
parent | 5f0a0f12e1e317d6ac2e053cea71925aedd3009c (diff) | |
download | php-git-bd49a0f1444885c1724b5322ab786ae634e2222a.tar.gz |
...
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 |