mike_k
asked on
Call method on parent object
I am having trouble calling a method on the parent object.
Right now, I have a class "DEM" that creates an instance of class "Decomposer" The Decomposer object needs to call a method on DEM, so I call call the constructor from DEM like this:
Decomposer d = new Decomposer(this);
on Decomposer, the constructor stores a reference to the parent
private DEM Parent;
public Decomposer(DEM parentRef){
Parent = parentRef;
}
when I try to call a method on the object Parent,
ArrayList r = (ArrayList) Parent.executeGddQuery(lst rGetFragsS QL);
note: executeGddQuery is a public function on DEM (public List executeGddQuery(String query))
I get a compile error:
csis532\dem\Decomposer.jav a:176: cannot resolve symbol
symbol : method executeGddQuery (java.lang.String)
location: interface ddbms.DEM
ArrayList r = (ArrayList) Parent.executeGddQuery(lst rGetFragsS QL);
Can someone help me to work out calling the parent object's method?
Thanks,
Mike
Right now, I have a class "DEM" that creates an instance of class "Decomposer" The Decomposer object needs to call a method on DEM, so I call call the constructor from DEM like this:
Decomposer d = new Decomposer(this);
on Decomposer, the constructor stores a reference to the parent
private DEM Parent;
public Decomposer(DEM parentRef){
Parent = parentRef;
}
when I try to call a method on the object Parent,
ArrayList r = (ArrayList) Parent.executeGddQuery(lst
note: executeGddQuery is a public function on DEM (public List executeGddQuery(String query))
I get a compile error:
csis532\dem\Decomposer.jav
symbol : method executeGddQuery (java.lang.String)
location: interface ddbms.DEM
ArrayList r = (ArrayList) Parent.executeGddQuery(lst
Can someone help me to work out calling the parent object's method?
Thanks,
Mike
The method appears it is not defined in the DEM interface
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.