Class org.as2lib.test.speed.MethodInvocation

org.as2lib.core.BasicClass
   +--org.as2lib.test.speed.AbstractTestResult
      +--org.as2lib.test.speed.MethodInvocation

Implemented Interfaces

TestResult

Description

MethodInvocation reflects a profiled method invocation.

Field Index

UNKNOWN, VOID

Method Index

new MethodInvocation()

getArguments(), getCaller(), getException(), getMethod(), getMethodName(), getName(), getPreviousMethodInvocation(), getReturnValue(), getSignature(), getTime(), isPreviousMethodInvocation(), setArguments(), setCaller(), setException(), setPreviousMethodInvocation(), setReturnValue(), setTime(), toString(), wasSuccessful()

Inherited from AbstractTestResult

getTimePercentage()

Constructor Detail

MethodInvocation

public function MethodInvocation(method:MethodInfo)

Constructs a new MethodInvocation instance.

Parameters

methodthe invoked method

Throws

IllegalArgumentExceptionif method is null or undefined

Field Detail

UNKNOWN

static public UNKNOWN:String
Designates an unknown type in the type signature.

VOID

static public VOID:String
Designates type Void in the type signature.

Method Detail

getMethod

public function getMethod(Void):MethodInfo

Returns the invoked method.

Return

the invoked method

getName

public function getName(Void):String

Returns the name of this method invocation. This is the method's name plus the signature of this method invocation.

Return

the name of this method invocation

Specified By

getName() in org.as2lib.test.speed.TestResult

getMethodName

public function getMethodName(Void):String

Returns the full name of the invoked method.

Return

the full name of the invoked method

getSignature

public function getSignature(Void):String

Returns the signature of this method invocation.

If any information needed to generate the signature is not defined, UNKNOWN is used as placeholder.

Return

this method invocation's signature

getTime

public function getTime(Void):Number

Returns the time in milliseconds needed for this method invocation.

Return

the time in milliseconds needed for this method invocation

Specified By

getTime() in org.as2lib.test.speed.TestResult

setTime

public function setTime(time:Number):Void

Sets the time in milliseconds needed for this method invocation.

Parameters

timethe time in milliseconds needed for this method invocation

getArguments

public function getArguments(Void):Array

Returns the arguments used for this method invocation.

Return

the arguments used for this method invocation

setArguments

public function setArguments(args:Array):Void

Sets the arguments used for this method invocation.

Parameters

argsthe arguments used for this method invocation

getReturnValue

public function getReturnValue(Void)

Returns this method invocation's return value.

Return

this method invocation's return value

setReturnValue

public function setReturnValue(returnValue):Void

Sets the return value of this method invocation.

Parameters

returnValuethe return value of this method invocation

getException

public function getException(Void)

Returns the exception thrown during this method invocation.

Return

the exception thrown during this method invocation

setException

public function setException(exception):Void

Sets the exception thrown during this method invocation.

Parameters

exceptionthe exception thrown during this method invocation

wasSuccessful

public function wasSuccessful(Void):Boolean

Returns whether this method invocation was successful. Successful means that it returned a proper return value and did not throw an exception.

Return

true if this method invocation was successful else false

getCaller

public function getCaller(Void):MethodInvocation

Returns the method invocation that called the method that resulted in this method invocation.

Return

the method invocation that called the method that resulted in this method.

setCaller

public function setCaller(caller:MethodInvocation):Void

Sets the method invocation that called the method that resulted in this method invocation.

Parameters

callerthe method invocation that called the method that resulted in this method invocation.

getPreviousMethodInvocation

public function getPreviousMethodInvocation(Void):MethodInvocation

Returns the previous method invocation.

Return

the previous method invocation

setPreviousMethodInvocation

public function setPreviousMethodInvocation(previousMethodInvocation:MethodInvocation):Void

Sets the previous method invocation.

Parameters

previousMethodInvocationthe previous method invocation

isPreviousMethodInvocation

public function isPreviousMethodInvocation(methodInvocation:MethodInvocation):Boolean

Checks whether this method invocation was invoked before the passed-in methodInvocation.

Parameters

methodInvocationthe method invocation to make the check upon

Return

true if this method invocation was invoked previously to the passed-in methodInvocation else false

toString

public function toString():String

Returns the string representation of this method invocation.

Parameters

Return

the string representation of this method invocation

Specified By

toString() in org.as2lib.core.BasicInterface

Overrides

toString() in org.as2lib.core.BasicClass