diff options
Diffstat (limited to 'src/test/java/cuchaz/enigma/inputs/inheritanceTree')
4 files changed, 126 insertions, 0 deletions
diff --git a/src/test/java/cuchaz/enigma/inputs/inheritanceTree/BaseClass.java b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/BaseClass.java new file mode 100644 index 0000000..4f9c5b0 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/BaseClass.java | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Lesser General Public | ||
| 5 | * License v3.0 which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.inputs.inheritanceTree; | ||
| 12 | |||
| 13 | // none/a | ||
| 14 | public abstract class BaseClass { | ||
| 15 | |||
| 16 | // a | ||
| 17 | private String m_name; | ||
| 18 | |||
| 19 | // <init>(Ljava/lang/String;)V | ||
| 20 | protected BaseClass(String name) { | ||
| 21 | m_name = name; | ||
| 22 | } | ||
| 23 | |||
| 24 | // a()Ljava/lang/String; | ||
| 25 | public String getName() { | ||
| 26 | return m_name; | ||
| 27 | } | ||
| 28 | |||
| 29 | // a()V | ||
| 30 | public abstract void doBaseThings(); | ||
| 31 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassA.java b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassA.java new file mode 100644 index 0000000..140d2a8 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassA.java | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Lesser General Public | ||
| 5 | * License v3.0 which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.inputs.inheritanceTree; | ||
| 12 | |||
| 13 | // none/b extends none/a | ||
| 14 | public abstract class SubclassA extends BaseClass { | ||
| 15 | |||
| 16 | // <init>(Ljava/lang/String;)V | ||
| 17 | protected SubclassA(String name) { | ||
| 18 | // call to none/a.<init>(Ljava/lang/String)V | ||
| 19 | super(name); | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassB.java b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassB.java new file mode 100644 index 0000000..99d149b --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassB.java | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Lesser General Public | ||
| 5 | * License v3.0 which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.inputs.inheritanceTree; | ||
| 12 | |||
| 13 | // none/c extends none/a | ||
| 14 | public class SubclassB extends BaseClass { | ||
| 15 | |||
| 16 | // a | ||
| 17 | private int m_numThings; | ||
| 18 | |||
| 19 | // <init>()V | ||
| 20 | protected SubclassB() { | ||
| 21 | // none/a.<init>(Ljava/lang/String;)V | ||
| 22 | super("B"); | ||
| 23 | |||
| 24 | // access to a | ||
| 25 | m_numThings = 4; | ||
| 26 | } | ||
| 27 | |||
| 28 | @Override | ||
| 29 | // a()V | ||
| 30 | public void doBaseThings() { | ||
| 31 | // call to none/a.a()Ljava/lang/String; | ||
| 32 | System.out.println("Base things by B! " + getName()); | ||
| 33 | } | ||
| 34 | |||
| 35 | // b()V | ||
| 36 | public void doBThings() { | ||
| 37 | // access to a | ||
| 38 | System.out.println("" + m_numThings + " B things!"); | ||
| 39 | } | ||
| 40 | } | ||
diff --git a/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubsubclassAA.java b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubsubclassAA.java new file mode 100644 index 0000000..2e414b7 --- /dev/null +++ b/src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubsubclassAA.java | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Lesser General Public | ||
| 5 | * License v3.0 which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.inputs.inheritanceTree; | ||
| 12 | |||
| 13 | // none/d extends none/b | ||
| 14 | public class SubsubclassAA extends SubclassA { | ||
| 15 | |||
| 16 | protected SubsubclassAA() { | ||
| 17 | // call to none/b.<init>(Ljava/lang/String;)V | ||
| 18 | super("AA"); | ||
| 19 | } | ||
| 20 | |||
| 21 | @Override | ||
| 22 | // a()Ljava/lang/String; | ||
| 23 | public String getName() { | ||
| 24 | // call to none/b.a()Ljava/lang/String; | ||
| 25 | return "subsub" + super.getName(); | ||
| 26 | } | ||
| 27 | |||
| 28 | @Override | ||
| 29 | // a()V | ||
| 30 | public void doBaseThings() { | ||
| 31 | // call to none/d.a()Ljava/lang/String; | ||
| 32 | System.out.println("Base things by " + getName()); | ||
| 33 | } | ||
| 34 | } | ||