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.perclass;
9
10 /***
11 * Other implementation For now explicit implements is needed (extends is not enough - bug in
12 * swapping)
13 *
14 * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
15 */
16 public class MyOtherImpl extends MyImpl implements Introductions, Cloneable {
17
18 public MyOtherImpl(Class targetClass) {
19 super(targetClass);
20 }
21
22 public void noArgs() throws RuntimeException {
23 }
24
25 public long longArg(long arg) {
26 return arg;
27 }
28
29 /***
30 * used by test case
31 */
32 public int intArg(int arg) {
33 return -1 * arg;
34 }
35
36 public short shortArg(short arg) {
37 return arg;
38 }
39
40 public double doubleArg(double arg) {
41 return arg;
42 }
43
44 public float floatArg(float arg) {
45 return arg;
46 }
47
48 public byte byteArg(byte arg) {
49 return arg;
50 }
51
52 public boolean booleanArg(boolean arg) {
53 return arg;
54 }
55
56 public char charArg(char arg) {
57 return arg;
58 }
59
60 public Object objectArg(Object arg) {
61 return arg;
62 }
63
64 public String[] arrayArg(String[] arg) {
65 return arg;
66 }
67
68 public int variousArguments1(String str, int i, float f, Object o, long l) throws RuntimeException {
69 return str.hashCode() + i + (int) f + o.hashCode() + (int) l;
70 }
71
72 public int variousArguments2(float f, int i, String str1, Object o, long l, String str2)
73 throws RuntimeException {
74 return (int) f + i + str1.hashCode() + o.hashCode() + (int) l + str2.hashCode();
75 }
76
77 public void getVoid() throws RuntimeException {
78 }
79
80 public long getLong() throws RuntimeException {
81 return 1L;
82 }
83
84 public int getInt() throws RuntimeException {
85 return -1;
86 }
87
88 public short getShort() throws RuntimeException {
89 return 1;
90 }
91
92 public double getDouble() throws RuntimeException {
93 return 1.1D;
94 }
95
96 public float getFloat() throws RuntimeException {
97 return 1.1F;
98 }
99
100 public byte getByte() throws RuntimeException {
101 return Byte.parseByte("1");
102 }
103
104 public char getChar() throws RuntimeException {
105 return 'A';
106 }
107
108 public boolean getBoolean() throws RuntimeException {
109 return true;
110 }
111 }