Class relationships: Correct Solution


Consider the follow class declarations:

public class Asrerd {
    public List<Etint> getCics() {
        ...
    }

    public File getCinsu() {
        ...
    }

    public String getAtChrac() {
        ...
    }
}

public class BaxTiho extends Mingiss {
    public List<Sillro> getPrums() {
        ...
    }
}

public class Blio {
    public List<Slaccil> getHuicos() {
        ...
    }

    public Snush getCavis() {
        ...
    }

    public List<Reurstest> getWeacks() {
        ...
    }
}

public class Clestchesm {
    public Asrerd getEnpri() {
        ...
    }

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

public class Epkne {
    public int getTric() {
        ...
    }

    public List<Ledstan> getOuFiors() {
        ...
    }
}

public class Etint {
    public int getIast() {
        ...
    }
}

public class Glau extends Musioght {
    public List<String> getNiPruse() {
        ...
    }
}

public class Grea {
    public List<PecKod> getIals() {
        ...
    }

    public byte[] getPaUx() {
        ...
    }
}

public class Helsi {
    public String getOiPrent() {
        ...
    }

    public List<Telpas> getIoEls() {
        ...
    }
}

public class Iasm {
    public List<String> getCurwu() {
        ...
    }

    public Vunsad getCesi() {
        ...
    }
}

public class Kest {
    public File getNoErpol() {
        ...
    }
}

public class Ledstan extends Grea {
    public int getMiPruc() {
        ...
    }
}

public class Midsput extends Helsi {
    public Iasm getZuwee() {
        ...
    }

    public Glau getLema() {
        ...
    }
}

public class Mingiss {
    public Splitla getCloun() {
        ...
    }

    public List<Midsput> getCespis() {
        ...
    }
}

public class Musioght {
    public List<Blio> getSaMeods() {
        ...
    }

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

public class Noro {
    public List<String> getPurt() {
        ...
    }
}

public class PecKod extends Clestchesm {
    public File getPhel() {
        ...
    }
}

public class Reurstest {
    public File getPenid() {
        ...
    }
}

public class Sillro {
    public int getFes() {
        ...
    }
}

public class Slaccil {
    public File getEor() {
        ...
    }
}

public class Snush {
    public Epkne getCeted() {
        ...
    }

    public String getArcor() {
        ...
    }
}

public class Splitla {
    public File getAtnun() {
        ...
    }
}

public class Telpas extends Kest {
    public Noro getUnEssme() {
        ...
    }
}

public class Vunsad {
    public int getKoxt() {
        ...
    }
}
  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:

    BaxTiho se

    ...and the following method:

    public void process(String item)

    ...write code to process the atChrac of each ial of each ouFior of the first saMeod of the first cespi of se.

    Solution

    for (Midsput cespi : se.getMingiss().getCespisList()) {
        for (Blio saMeod : cespi.getLema().getMusioght().getSaMeodsList()) {
            process(saMeod.getCavis().getCeted().getOuFiors().get(0).getGrea().getIals().get(0).getClestchesm().getEnpri().getAtChrac());
        }
    }

Related puzzles: