Re: Getting Information on a Calling Class
- From: Lew <lew@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 05 Jun 2007 08:01:21 -0400
Hal Vaughan <hal@xxxxxxxxxxxxxxxxxxxx> writes:
I have a case where I'd like to return different data depending
on which class is calling the current class.
Is there any way to get the instance of the object that called
a method?
interface Caller
{
}
class Callee
{
public void callMe( Caller caller )
{
doSomethingWith( caller );
}
}
class ACaller implements Caller
{
public void someMethod()
{
Callee callee = new Callee();
callee.callMe( this );
}
}
--
Lew
.
- Follow-Ups:
- Re: Getting Information on a Calling Class
- From: Hal Vaughan
- Re: Getting Information on a Calling Class
- References:
- Getting Information on a Calling Class
- From: Hal Vaughan
- Getting Information on a Calling Class
- Prev by Date: Re: setting up j2ee 1.3 RI
- Next by Date: Re: Basic threading concept
- Previous by thread: Getting Information on a Calling Class
- Next by thread: Re: Getting Information on a Calling Class
- Index(es):
Relevant Pages
|