Class relationships: Correct Solution


Consider the follow class declarations:

public class AfiSweckbint extends Puntpe {
    public List<Mapad> getPiSas() {
        ...
    }
}

public class Broshuen {
    public String getElAdcec() {
        ...
    }
}

public class Cressmeal {
    public List<Broshuen> getMuRhisses() {
        ...
    }

    public AfiSweckbint getQesha() {
        ...
    }
}

public class Daless {
    public String getEgla() {
        ...
    }
}

public class Dodith {
    public SehMairos getTeo() {
        ...
    }

    public List<Histrin> getOnhis() {
        ...
    }
}

public class Hastfi {
    public String getIspil() {
        ...
    }

    public Parpo getHimo() {
        ...
    }
}

public class Histrin extends Cressmeal {
    public String getBiCludi() {
        ...
    }
}

public class Iapu {
    public int getDiMe() {
        ...
    }
}

public class Mapad {
    public String getZemed() {
        ...
    }

    public List<Rodclos> getCeFiates() {
        ...
    }
}

public class Mewa {
    public List<Daless> getPrids() {
        ...
    }

    public List<Nehull> getDioas() {
        ...
    }
}

public class Nehull {
    public byte[] getNuSi() {
        ...
    }
}

public class Otdro {
    public Rorm getFiColho() {
        ...
    }

    public int getWhemu() {
        ...
    }
}

public class Pangtret {
    public List<String> getHepi() {
        ...
    }
}

public class Parpo extends Otdro {
    public List<String> getPlont() {
        ...
    }
}

public class Preldod extends Mewa {
    public List<Hastfi> getPecs() {
        ...
    }
}

public class Puntpe {
    public Shal getIss() {
        ...
    }

    public File getPesma() {
        ...
    }
}

public class Rodclos {
    public File getPipel() {
        ...
    }

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

public class Rorm extends Dodith {
    public byte[] getSted() {
        ...
    }
}

public class SehMairos {
    public byte[] getOnhes() {
        ...
    }

    public Pangtret getVem() {
        ...
    }
}

public class Shal {
    public Iapu getMiEngen() {
        ...
    }

    public File getMecas() {
        ...
    }
}
  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:

    Preldod ciss

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the memis of each ceFiate of the first piSa of the first onhi of the first pec of ciss.

    Solution

    for (Hastfi pec : ciss.getPecsList()) {
        for (Histrin onhi : pec.getHimo().getOtdro().getFiColho().getDodith().getOnhisList()) {
            for (Mapad piSa : onhi.getCressmeal().getQesha().getPiSasList()) {
                process(piSa.getCeFiates().get(0).getMemis());
            }
        }
    }

Related puzzles: