summaryrefslogtreecommitdiffstats
path: root/src/de/fhswf/in/inf/upnfx/util/ObservableDoubleStack.java
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-06-09 09:13:55 +0200
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-06-09 09:13:55 +0200
commitd8cd813ddc54c455eb3071795038b97b72dc1ee9 (patch)
tree3da37c0ec1d4d0f2de6e3e1a981542df8222ae6d /src/de/fhswf/in/inf/upnfx/util/ObservableDoubleStack.java
parentf74cd282da1f14bc3d2d768b2f68b8f6d6429e68 (diff)
downloadUpnFx-d8cd813ddc54c455eb3071795038b97b72dc1ee9.tar.gz
UpnFx-d8cd813ddc54c455eb3071795038b97b72dc1ee9.zip
Add working version of UpnFx
Diffstat (limited to 'src/de/fhswf/in/inf/upnfx/util/ObservableDoubleStack.java')
-rw-r--r--src/de/fhswf/in/inf/upnfx/util/ObservableDoubleStack.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/de/fhswf/in/inf/upnfx/util/ObservableDoubleStack.java b/src/de/fhswf/in/inf/upnfx/util/ObservableDoubleStack.java
new file mode 100644
index 0000000..8fbcc6d
--- /dev/null
+++ b/src/de/fhswf/in/inf/upnfx/util/ObservableDoubleStack.java
@@ -0,0 +1,40 @@
+/**
+ *
+ */
+
+package de.fhswf.in.inf.upnfx.util;
+
+import javafx.beans.property.SimpleListProperty;
+import javafx.collections.FXCollections;
+
+/**
+ * An observable list that has the Stack methods.
+ *
+ * @author Stefan Suhren
+ * @version 1.0
+ */
+public class ObservableDoubleStack extends SimpleListProperty<Double>
+{
+ public ObservableDoubleStack()
+ {
+ super(FXCollections.observableArrayList());
+ }
+
+ public Double peek()
+ {
+ return get(size() - 1);
+ }
+
+ public Double pop()
+ {
+ Double ret = get(size() - 1);
+ remove(size() - 1);
+ return ret;
+ }
+
+ public void push(Double item)
+ {
+ add(item);
+ }
+
+}