aspose file tools*
The moose likes Beginning Java and the fly likes Accessing Methods that are part of a SET inside a MAP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Accessing Methods that are part of a SET inside a MAP

Joe Solis
Greenhorn

Joined: Jun 17, 2010
Posts: 5
I am working on a project uses a MAP of Insureds, which contains a SET of Coverages, which in turn contains a SET of Products. Inside Class: Coverage, there is a METHOD called: totalProductCost that iterates through the SET of products and accumulates the cost of the products for each coverage.

What I am trying to do in a Class called "CoverageReport" is to "Drill-down" into Class: Coverage to get at this Method for reporting.

In the Java class I'm taking, we learned how to access collection data on a single level, but not how to "drill-down" into multiple levels.


Thanks.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You haven't actually provided enough information to help... is the method you're trying to call a static method? Is it an instance method that somehow tracks all of the class's instances? Are you trying to add up all the products of all the coverages, or just the products for a specific coverage? Are you trying to iterate over the coverages and sum up each coverages' products separately?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No, this one.
 
 
subject: Accessing Methods that are part of a SET inside a MAP