File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

Accessing Methods that are part of a SET inside a MAP

 
Joe Solis
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
No, this one.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic