aboutsummaryrefslogtreecommitdiffstats
path: root/main/utils/Counter.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/utils/Counter.java')
-rw-r--r--main/utils/Counter.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/main/utils/Counter.java b/main/utils/Counter.java
new file mode 100644
index 0000000..a0bf0fd
--- /dev/null
+++ b/main/utils/Counter.java
@@ -0,0 +1,27 @@
+package com.jantuomi.interpreter.main.utils;
+
+/**
+ * Created by jan on 13.6.2016.
+ */
+public class Counter {
+ private int value = 0;
+
+ public int advance() {
+ value = value + 1;
+ return value;
+ }
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ }
+
+ public Counter clone() {
+ Counter c = new Counter();
+ c.value = value;
+ return c;
+ }
+}