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;
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 targetClass) {
21 super(targetClass);
22 }
23
24 public MyOtherImpl(Object target) {
25 super(target);
26 }
27
28 public void noArgs() throws RuntimeException {
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 objectArg(Object arg) {
67 return arg;
68 }
69
70 public String[] arrayArg(String[] arg) {
71 return arg;
72 }
73
74 public int variousArguments1(String str, int i, float f, Object o, long l) throws RuntimeException {
75 return str.hashCode() + i + (int) f + o.hashCode() + (int) l;
76 }
77
78 public int variousArguments2(float f, int i, String str1, Object o, long l, String str2)
79 throws RuntimeException {
80 return (int) f + i + str1.hashCode() + o.hashCode() + (int) l + str2.hashCode();
81 }
82
83 public void getVoid() throws RuntimeException {
84 }
85
86 public long getLong() throws RuntimeException {
87 return 1L;
88 }
89
90 public int getInt() throws RuntimeException {
91 return -1;
92 }
93
94 public short getShort() throws RuntimeException {
95 return 1;
96 }
97
98 public double getDouble() throws RuntimeException {
99 return 1.1D;
100 }
101
102 public float getFloat() throws RuntimeException {
103 return 1.1F;
104 }
105
106 public byte getByte() throws RuntimeException {
107 return Byte.parseByte("1");
108 }
109
110 public char getChar() throws RuntimeException {
111 return 'A';
112 }
113
114 public boolean getBoolean() throws RuntimeException {
115 return true;
116 }
117 }