diff options
author | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
commit | 144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch) | |
tree | b12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/ajdoc/input/applesJava/Apple.java | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/ajdoc/input/applesJava/Apple.java')
-rw-r--r-- | tests/ajdoc/input/applesJava/Apple.java | 114 |
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..." ); + } +} |