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.perclass;
008:
009: /**
010: * Replacement for MyImpl mixin
011: *
012: * @author <a href="mailto:alex@gnilux.com">Alexandre Vasseur </a>
013: */
014: public class MyImplReplacement implements Cloneable, Introductions {
015: public MyImplReplacement(Class target) {
016: }
017:
018: public void noArgs() throws RuntimeException {
019: }
020:
021: public long longArg(long arg) {
022: return arg;
023: }
024:
025: /**
026: * Used in test suite: replacement does a -2 x
027: */
028: public int intArg(int arg) {
029: return -2 * arg;
030: }
031:
032: public short shortArg(short arg) {
033: return arg;
034: }
035:
036: public double doubleArg(double arg) {
037: return arg;
038: }
039:
040: public float floatArg(float arg) {
041: return arg;
042: }
043:
044: public byte byteArg(byte arg) {
045: return arg;
046: }
047:
048: public boolean booleanArg(boolean arg) {
049: return arg;
050: }
051:
052: public char charArg(char arg) {
053: return arg;
054: }
055:
056: public Object objectArg(Object arg) {
057: return arg;
058: }
059:
060: public String[] arrayArg(String[] arg) {
061: return arg;
062: }
063:
064: public int variousArguments1(String str, int i, float f, Object o,
065: long l) throws RuntimeException {
066: return str.hashCode() + i + (int) f + o.hashCode() + (int) l;
067: }
068:
069: public int variousArguments2(float f, int i, String str1, Object o,
070: long l, String str2) throws RuntimeException {
071: return (int) f + i + str1.hashCode() + o.hashCode() + (int) l
072: + str2.hashCode();
073: }
074:
075: public void getVoid() throws RuntimeException {
076: }
077:
078: public long getLong() throws RuntimeException {
079: return 1L;
080: }
081:
082: public int getInt() throws RuntimeException {
083: return 1;
084: }
085:
086: public short getShort() throws RuntimeException {
087: return 1;
088: }
089:
090: public double getDouble() throws RuntimeException {
091: return 1.1D;
092: }
093:
094: public float getFloat() throws RuntimeException {
095: return 1.1F;
096: }
097:
098: public byte getByte() throws RuntimeException {
099: return Byte.parseByte("1");
100: }
101:
102: public char getChar() throws RuntimeException {
103: return 'A';
104: }
105:
106: public boolean getBoolean() throws RuntimeException {
107: return true;
108: }
109:
110: public void exceptionThrower() throws Throwable {
111: throw new UnsupportedOperationException("this is a test");
112: }
113:
114: public void exceptionThrowerChecked() throws CheckedException {
115: throw new CheckedException();
116: }
117: }
|