summaryrefslogtreecommitdiffstats
path: root/tests/ajdoc/input/applesJava/Apple.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ajdoc/input/applesJava/Apple.java')
-rw-r--r--tests/ajdoc/input/applesJava/Apple.java114
1 files changed, 114 insertions, 0 deletions
diff --git a/tests/ajdoc/input/applesJava/Apple.java b/tests/ajdoc/input/applesJava/Apple.java
new file mode 100644
index 000000000..08a4724ca
--- /dev/null
+++ b/tests/ajdoc/input/applesJava/Apple.java
@@ -0,0 +1,114 @@
+
+import java.io.Serializable;
+import java.io.IOException;
+
+/**
+ * This class represents an apple that has the following two attributes
+ * <UL>
+ * <LI>a variety (i.e. "Macintosh" or "Granny Smith")
+ * <LI>a brusing factor represnting how badly bruised the apple is
+ * </UL>
+ *
+ * @author Mik Kersten
+ * @version $Version$
+ */
+
+public class Apple implements Serializable
+{
+ private String variety = null;
+ private int bruising = 0;
+
+ /**
+ * Default constructor.
+ *
+ * @param newVariety the type of variety for this apple
+ */
+ public Apple( String newVariety )
+ {
+ variety = newVariety;
+ }
+
+ /**
+ * This inner class represents apple seeds.
+ */
+ public class AppleSeed {
+ private int weight = 0;
+ private SeedContents seedContents = null;
+
+ /**
+ * This is how you get poison from the apple.
+ */
+ public void getArsenic() {
+ System.out.println( ">> getting arsenic" );
+ }
+
+ /**
+ * Reperesents the contents of the seeds.
+ */
+ public class SeedContents {
+ public String core = null;
+ public String shell = null;
+ }
+ }
+
+ /**
+ * Sets the bruising factor of the apple.
+ *
+ * @param bruiseFactor the new bruising factor
+ */
+ public void bruise( int bruiseFactor )
+ {
+ bruising = bruising + bruiseFactor;
+
+ if ( bruising > 100 ) bruising = 100;
+ if ( bruising < 0 ) bruising = 0;
+ }
+
+
+ /**
+ * Returns the bruising factor.
+ *
+ * @return bruising the bruising factor associated with the apple
+ */
+ public int getBruising()
+ {
+ return bruising;
+ }
+
+
+ /**
+ * Serializes the apple object.
+ *
+ * @param oos stream that the object is written to
+ */
+ private void writeObject( java.io.ObjectOutputStream oos )
+ throws IOException
+ {
+ // TODO: implement
+ }
+
+
+ /**
+ * Reads in the apple object.
+ *
+ * @param ois stream that the object is read from
+ */
+ private void readObject( java.io.ObjectInputStream ois )
+ throws IOException, ClassNotFoundException
+ {
+ // TODO: implement
+ }
+}
+
+/**
+ * Stub class to represent apple peeling.
+ */
+class ApplePealer
+{
+ /**
+ * Stub for peeling the apple.
+ */
+ public void peelApple() {
+ System.out.println( ">> peeling the apple..." );
+ }
+}