Class relationships: Correct Solution


Consider the follow class declarations:

public class Aeosmphed {
    public File getOdpan() {
        ...
    }
}

public class Amdan {
    public int getRaCashi() {
        ...
    }

    public Cuxrha getSpral() {
        ...
    }
}

public class Arteng {
    public List<Ingspost> getAnRais() {
        ...
    }

    public List<String> getOdmod() {
        ...
    }
}

public class Astcil {
    public Calmist getRoSpeu() {
        ...
    }

    public Deud getRae() {
        ...
    }
}

public class Astprio {
    public int getBrol() {
        ...
    }
}

public class Calmist extends Amdan {
    public int getAnnil() {
        ...
    }
}

public class Cuxrha extends Arteng {
    public Sendthued getNaMe() {
        ...
    }

    public List<Siel> getCisses() {
        ...
    }
}

public class Derhes {
    public int getDaRe() {
        ...
    }
}

public class Deud {
    public byte[] getDac() {
        ...
    }
}

public class Eeng extends Astcil {
    public byte[] getUcCe() {
        ...
    }
}

public class Eurm {
    public List<Aeosmphed> getCiolis() {
        ...
    }

    public List<Laral> getPocts() {
        ...
    }
}

public class Helspo extends Prismsa {
    public File getRac() {
        ...
    }
}

public class Ingspost {
    public String getHina() {
        ...
    }
}

public class Laral extends Meecde {
    public int getNePrezi() {
        ...
    }
}

public class Meecde {
    public File getOrUce() {
        ...
    }

    public int getCec() {
        ...
    }
}

public class Mellwiess {
    public String getZeCarce() {
        ...
    }
}

public class Prismsa {
    public List<RalQasm> getBatases() {
        ...
    }

    public List<Shess> getGlings() {
        ...
    }

    public List<Triss> getSphers() {
        ...
    }
}

public class RalQasm {
    public List<String> getUpMial() {
        ...
    }
}

public class Sendthued {
    public File getZeg() {
        ...
    }
}

public class Shess extends Derhes {
    public int getEnges() {
        ...
    }
}

public class Siel {
    public Mellwiess getDest() {
        ...
    }

    public Eurm getStek() {
        ...
    }
}

public class Swascer {
    public File getBiSheu() {
        ...
    }

    public List<Eeng> getOaSpibs() {
        ...
    }
}

public class Triss extends Wudni {
    public Astprio getOnli() {
        ...
    }

    public Swascer getAca() {
        ...
    }
}

public class Wudni {
    public int getDra() {
        ...
    }
}
  1. Draw a diagram showing the class relationships.

    You only need to diagram the classes listed above. You only need to show the name of each class; do not show their methods or properties.

    Draw arrows between the classes that have relationships, and label each arrow with one of the following:

    Make sure your arrows point in the correct direction!

    Solution

  2. Given the following variable:

    Helspo neas

    ...and the following method:

    public void process(int item)

    ...write code to process the cec of each poct of each ciss of the first oaSpib of the first spher of neas.

    Solution

    for (Triss spher : neas.getPrismsa().getSphersList()) {
        for (Eeng oaSpib : spher.getAca().getOaSpibsList()) {
            process(oaSpib.getAstcil().getRoSpeu().getAmdan().getSpral().getCisses().get(0).getStek().getPocts().get(0).getMeecde().getCec());
        }
    }

Related puzzles: