KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > mixin > perinstance > MyOtherImpl


1 /**************************************************************************************
2  * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
3  * http://aspectwerkz.codehaus.org *
4  * ---------------------------------------------------------------------------------- *
5  * The software in this package is published under the terms of the LGPL license *
6  * a copy of which has been included with this distribution in the license.txt file. *
7  **************************************************************************************/

8 package test.mixin.perinstance;
9
10 import java.io.Serializable JavaDoc;
11
12 /**
13  * Other implementation For now explicit implements is needed (extends is not enough - bug in
14  * swapping)
15  *
16  * @author <a HREF="mailto:jboner@codehaus.org">Jonas BonŽr </a>
17  */

18 public class MyOtherImpl extends MyImpl {
19
20     public MyOtherImpl(Class JavaDoc targetClass) {
21         super(targetClass);
22     }
23
24     public MyOtherImpl(Object JavaDoc target) {
25         super(target);
26     }
27
28     public void noArgs() throws RuntimeException JavaDoc {
29     }
30
31     public long longArg(long arg) {
32         return arg;
33     }
34
35     /**
36      * used by test case
37      */

38     public int intArg(int arg) {
39         return -1 * arg;
40     }
41
42     public short shortArg(short arg) {
43         return arg;
44     }
45
46     public double doubleArg(double arg) {
47         return arg;
48     }
49
50     public float floatArg(float arg) {
51         return arg;
52     }
53
54     public byte byteArg(byte arg) {
55         return arg;
56     }
57
58     public boolean booleanArg(boolean arg) {
59         return arg;
60     }
61
62     public char charArg(char arg) {
63         return arg;
64     }
65
66     public Object JavaDoc objectArg(Object JavaDoc arg) {
67         return arg;
68     }
69
70     public String JavaDoc[] arrayArg(String JavaDoc[] arg) {
71         return arg;
72     }
73
74     public int variousArguments1(String JavaDoc str, int i, float f, Object JavaDoc o, long l) throws RuntimeException JavaDoc {
75         return str.hashCode() + i + (int) f + o.hashCode() + (int) l;
76     }
77
78     public int variousArguments2(float f, int i, String JavaDoc str1, Object JavaDoc o, long l, String JavaDoc str2)
79             throws RuntimeException JavaDoc {
80         return (int) f + i + str1.hashCode() + o.hashCode() + (int) l + str2.hashCode();
81     }
82
83     public void getVoid() throws RuntimeException JavaDoc {
84     }
85
86     public long getLong() throws RuntimeException JavaDoc {
87         return 1L;
88     }
89
90     public int getInt() throws RuntimeException JavaDoc {
91         return -1;
92     }
93
94     public short getShort() throws RuntimeException JavaDoc {
95         return 1;
96     }
97
98     public double getDouble() throws RuntimeException JavaDoc {
99         return 1.1D;
100     }
101
102     public float getFloat() throws RuntimeException JavaDoc {
103         return 1.1F;
104     }
105
106     public byte getByte() throws RuntimeException JavaDoc {
107         return Byte.parseByte("1");
108     }
109
110     public char getChar() throws RuntimeException JavaDoc {
111         return 'A';
112     }
113
114     public boolean getBoolean() throws RuntimeException JavaDoc {
115         return true;
116     }
117 }
118
Popular Tags