001: /**************************************************************************************
002: * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
003: * http://aspectwerkz.codehaus.org *
004: * ---------------------------------------------------------------------------------- *
005: * The software in this package is published under the terms of the LGPL license *
006: * a copy of which has been included with this distribution in the license.txt file. *
007: **************************************************************************************/package test.mixin.perinstance;
008:
009: import java.io.Serializable;
010:
011: /**
012: * Other implementation For now explicit implements is needed (extends is not enough - bug in
013: * swapping)
014: *
015: * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
016: */
017: public class MyOtherImpl extends MyImpl {
018:
019: public MyOtherImpl(Class targetClass) {
020: super (targetClass);
021: }
022:
023: public MyOtherImpl(Object target) {
024: super (target);
025: }
026:
027: public void noArgs() throws RuntimeException {
028: }
029:
030: public long longArg(long arg) {
031: return arg;
032: }
033:
034: /**
035: * used by test case
036: */
037: public int intArg(int arg) {
038: return -1 * arg;
039: }
040:
041: public short shortArg(short arg) {
042: return arg;
043: }
044:
045: public double doubleArg(double arg) {
046: return arg;
047: }
048:
049: public float floatArg(float arg) {
050: return arg;
051: }
052:
053: public byte byteArg(byte arg) {
054: return arg;
055: }
056:
057: public boolean booleanArg(boolean arg) {
058: return arg;
059: }
060:
061: public char charArg(char arg) {
062: return arg;
063: }
064:
065: public Object objectArg(Object arg) {
066: return arg;
067: }
068:
069: public String[] arrayArg(String[] arg) {
070: return arg;
071: }
072:
073: public int variousArguments1(String str, int i, float f, Object o,
074: long l) throws RuntimeException {
075: return str.hashCode() + i + (int) f + o.hashCode() + (int) l;
076: }
077:
078: public int variousArguments2(float f, int i, String str1, Object o,
079: long l, String str2) throws RuntimeException {
080: return (int) f + i + str1.hashCode() + o.hashCode() + (int) l
081: + str2.hashCode();
082: }
083:
084: public void getVoid() throws RuntimeException {
085: }
086:
087: public long getLong() throws RuntimeException {
088: return 1L;
089: }
090:
091: public int getInt() throws RuntimeException {
092: return -1;
093: }
094:
095: public short getShort() throws RuntimeException {
096: return 1;
097: }
098:
099: public double getDouble() throws RuntimeException {
100: return 1.1D;
101: }
102:
103: public float getFloat() throws RuntimeException {
104: return 1.1F;
105: }
106:
107: public byte getByte() throws RuntimeException {
108: return Byte.parseByte("1");
109: }
110:
111: public char getChar() throws RuntimeException {
112: return 'A';
113: }
114:
115: public boolean getBoolean() throws RuntimeException {
116: return true;
117: }
118: }
|