diff options
Diffstat (limited to 'tests/ajdoc/input/applesJava')
-rw-r--r-- | tests/ajdoc/input/applesJava/Apple.java | 114 | ||||
-rw-r--r-- | tests/ajdoc/input/applesJava/AppleCrate.java | 52 | ||||
-rw-r--r-- | tests/ajdoc/input/applesJava/BigRigAspect.java | 15 | ||||
-rw-r--r-- | tests/ajdoc/input/applesJava/TransportAspect.java | 24 |
4 files changed, 205 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..." ); + } +} diff --git a/tests/ajdoc/input/applesJava/AppleCrate.java b/tests/ajdoc/input/applesJava/AppleCrate.java new file mode 100644 index 000000000..fb9457006 --- /dev/null +++ b/tests/ajdoc/input/applesJava/AppleCrate.java @@ -0,0 +1,52 @@ + +import java.io.Serializable; +import java.io.IOException; + +/** + * This class represents an apple crate that is used for transporting apples. + * The apples are contained in an array of <CODE>Apple</CODE> objects. + * + * @author Mik Kersten + * @version $Version$ + * + * @see Apple + */ + +public class AppleCrate implements Serializable +{ + Apple[] crateContents = null; + + /** + * Default constructor. + * + * @param newCrateContents an array of <CODE>Apple</CODE> objects + */ + public AppleCrate( Apple[] newCrateContents ) + { + crateContents = newCrateContents; + } + + /** + * A crate is sellable if the apples are bruised 50% or less on average. + * + * @return <CODE>true</CODE> if the the apples can be sold + */ + public boolean isSellable() + { + int bruising = 0; + for ( int i = 0; i < crateContents.length; i++ ) + { + bruising = bruising + crateContents[i].getBruising(); + } + + if ( (bruising/crateContents.length) > 50 ) + { + return false; + } + else + { + return true; + } + } + +}
\ No newline at end of file diff --git a/tests/ajdoc/input/applesJava/BigRigAspect.java b/tests/ajdoc/input/applesJava/BigRigAspect.java new file mode 100644 index 000000000..05be8a5e7 --- /dev/null +++ b/tests/ajdoc/input/applesJava/BigRigAspect.java @@ -0,0 +1,15 @@ + +/** + * This aspect represents upacking apples after an airplane trip. + * + * @author Mik Kersten + * @version $Version$ + */ + +public class BigRigAspect extends TransportAspect +{ + /** + * Default constructor + */ + public BigRigAspect() {} +} diff --git a/tests/ajdoc/input/applesJava/TransportAspect.java b/tests/ajdoc/input/applesJava/TransportAspect.java new file mode 100644 index 000000000..b9256998f --- /dev/null +++ b/tests/ajdoc/input/applesJava/TransportAspect.java @@ -0,0 +1,24 @@ + +/** + * This aspect crosscuts the process of shipping apples. + * + * @author Mik Kersten + * @version $Version$ + */ + +public class TransportAspect +{ + private String crateName = "temp crate"; + + /** + * Bruises each apple in the crate according to the bruise facor. The bruise + * factor is an integer that is passed as a parameter. + */ + private void bruiser( int bruiseFactor ) + { + for ( int i = 0; i < 5; i++ ) + { + System.out.println( "bruising" ); + } + } +} |