From 4be005617b3b8c3578cca07c5d085d12916f0d1d Mon Sep 17 00:00:00 2001 From: lclc98 Date: Thu, 30 Jun 2016 00:49:21 +1000 Subject: Json format (#2) * Added new format * Fixed bug * Updated Version --- .../enigma/inputs/inheritanceTree/BaseClass.java | 31 +++++++++++++++++ .../enigma/inputs/inheritanceTree/SubclassA.java | 21 ++++++++++++ .../enigma/inputs/inheritanceTree/SubclassB.java | 40 ++++++++++++++++++++++ .../inputs/inheritanceTree/SubsubclassAA.java | 34 ++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 src/test/java/cuchaz/enigma/inputs/inheritanceTree/BaseClass.java create mode 100644 src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassA.java create mode 100644 src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubclassB.java create mode 100644 src/test/java/cuchaz/enigma/inputs/inheritanceTree/SubsubclassAA.java (limited to 'src/test/java/cuchaz/enigma/inputs/inheritanceTree') 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 @@ +/******************************************************************************* + * Copyright (c) 2015 Jeff Martin. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser General Public + * License v3.0 which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl.html + * + * Contributors: + * Jeff Martin - initial API and implementation + ******************************************************************************/ +package cuchaz.enigma.inputs.inheritanceTree; + +// none/a +public abstract class BaseClass { + + // a + private String m_name; + + // (Ljava/lang/String;)V + protected BaseClass(String name) { + m_name = name; + } + + // a()Ljava/lang/String; + public String getName() { + return m_name; + } + + // a()V + public abstract void doBaseThings(); +} 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 @@ +/******************************************************************************* + * Copyright (c) 2015 Jeff Martin. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser General Public + * License v3.0 which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl.html + * + * Contributors: + * Jeff Martin - initial API and implementation + ******************************************************************************/ +package cuchaz.enigma.inputs.inheritanceTree; + +// none/b extends none/a +public abstract class SubclassA extends BaseClass { + + // (Ljava/lang/String;)V + protected SubclassA(String name) { + // call to none/a.(Ljava/lang/String)V + super(name); + } +} 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 @@ +/******************************************************************************* + * Copyright (c) 2015 Jeff Martin. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser General Public + * License v3.0 which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl.html + * + * Contributors: + * Jeff Martin - initial API and implementation + ******************************************************************************/ +package cuchaz.enigma.inputs.inheritanceTree; + +// none/c extends none/a +public class SubclassB extends BaseClass { + + // a + private int m_numThings; + + // ()V + protected SubclassB() { + // none/a.(Ljava/lang/String;)V + super("B"); + + // access to a + m_numThings = 4; + } + + @Override + // a()V + public void doBaseThings() { + // call to none/a.a()Ljava/lang/String; + System.out.println("Base things by B! " + getName()); + } + + // b()V + public void doBThings() { + // access to a + System.out.println("" + m_numThings + " B things!"); + } +} 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 @@ +/******************************************************************************* + * Copyright (c) 2015 Jeff Martin. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser General Public + * License v3.0 which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl.html + * + * Contributors: + * Jeff Martin - initial API and implementation + ******************************************************************************/ +package cuchaz.enigma.inputs.inheritanceTree; + +// none/d extends none/b +public class SubsubclassAA extends SubclassA { + + protected SubsubclassAA() { + // call to none/b.(Ljava/lang/String;)V + super("AA"); + } + + @Override + // a()Ljava/lang/String; + public String getName() { + // call to none/b.a()Ljava/lang/String; + return "subsub" + super.getName(); + } + + @Override + // a()V + public void doBaseThings() { + // call to none/d.a()Ljava/lang/String; + System.out.println("Base things by " + getName()); + } +} -- cgit v1.2.3