I am stuck with one of the programmatic logic implementation.Can any one please help me in this regards.The issue is described below.

I have class called Event and Method.The structure looks like below.

Class Event {
private long eventId;
private String eventName;
private Map<String,Method> methods;
//setters and getters

class Method {
private long methodId;
private String methodName;
private Event triggeredEvent;
// setters and getters.

I have a top level Event and it contains a map of Methods (objects of Method class) and again each method can contain one triggered event which again a class of Event.The triggered event can contain again methods.

My issue is to traverse from top level Event to down level event and find out the event count and delivery method count at each level

Attached is tree structure of the issue with a sample example and result expected.

I have been struggling to implement this logic.Can any one please help me out.[IMG]C:\Users\lc7143\Desktop\Capture.jpg[/IMG]