diff options
author | Kenny Ballou <kballou@devnulllabs.io> | 2018-11-19 22:59:50 -0700 |
---|---|---|
committer | Kenny Ballou <kballou@devnulllabs.io> | 2018-11-19 22:59:50 -0700 |
commit | ea3e1b949dcbdc09518f17eee0bcf21d41d76896 (patch) | |
tree | 7ec7a7fb4df67815a9b7bb0e4d95d67c4050e2a2 /tutorial/examples/mixin/Undo.oj | |
download | openjava-ea3e1b949dcbdc09518f17eee0bcf21d41d76896.tar.gz openjava-ea3e1b949dcbdc09518f17eee0bcf21d41d76896.tar.xz |
OJ (aka OpenJava) modernization/mirroring
Signed-off-by: Kenny Ballou <kballou@devnulllabs.io>
Diffstat (limited to 'tutorial/examples/mixin/Undo.oj')
-rw-r--r-- | tutorial/examples/mixin/Undo.oj | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tutorial/examples/mixin/Undo.oj b/tutorial/examples/mixin/Undo.oj new file mode 100644 index 0000000..66ad9a9 --- /dev/null +++ b/tutorial/examples/mixin/Undo.oj @@ -0,0 +1,19 @@ +package examples.mixin;
+
+
+public class Undo
+{
+ inherited String getText();
+ inherited void setText(String s);
+
+ String lastText;
+
+ public void setText(String s) {
+ lastText = getText();
+ super.setText(s);
+ }
+
+ public void undo() {
+ super.setText(lastText);
+ }
+}
|