Class relationships: Correct Solution


Consider the follow class declarations:

public class Beasol extends Triou {
    public Dunnia getTaSeng() {
        ...
    }
}

public class Cloiss {
    public List<String> getCarm() {
        ...
    }

    public List<Ituix> getLoses() {
        ...
    }
}

public class Dunnia {
    public int getAuch() {
        ...
    }

    public List<Ludeuc> getElTis() {
        ...
    }
}

public class Enqie {
    public Pockphe getBous() {
        ...
    }

    public PseIss getSne() {
        ...
    }
}

public class Holtrid {
    public File getEcsir() {
        ...
    }

    public Raplen getBiank() {
        ...
    }
}

public class Ituix {
    public String getOfess() {
        ...
    }
}

public class Jioo extends Petch {
    public Cloiss getDavo() {
        ...
    }
}

public class Kerbu {
    public List<OtiSeiss> getRiKnos() {
        ...
    }

    public Enqie getTojar() {
        ...
    }

    public List<Stos> getClagis() {
        ...
    }
}

public class Ludeuc extends Kerbu {
    public List<String> getHefe() {
        ...
    }
}

public class NesEni {
    public File getDaci() {
        ...
    }
}

public class Nossrung {
    public int getLabo() {
        ...
    }
}

public class OtiSeiss {
    public int getLaofe() {
        ...
    }
}

public class Petch {
    public int getGri() {
        ...
    }

    public Splosmpot getOrTe() {
        ...
    }
}

public class Pockphe {
    public byte[] getBoi() {
        ...
    }
}

public class Proumrod extends Scos {
    public String getAfoss() {
        ...
    }
}

public class PseIss {
    public String getPid() {
        ...
    }
}

public class Raplen {
    public File getCeass() {
        ...
    }

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

public class Renel {
    public List<Nossrung> getUths() {
        ...
    }

    public File getPicha() {
        ...
    }
}

public class Scos {
    public List<Holtrid> getTrases() {
        ...
    }

    public String getLom() {
        ...
    }
}

public class Splosmpot extends Renel {
    public List<Beasol> getIosses() {
        ...
    }
}

public class Stos extends NesEni {
    public Proumrod getWeHusot() {
        ...
    }
}

public class Triou {
    public byte[] getUien() {
        ...
    }
}
  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:

    Jioo nio

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the cici of each tras of each clagi of the first elTi of the first ioss of nio.

    Solution

    for (Beasol ioss : nio.getPetch().getOrTe().getIossesList()) {
        for (Ludeuc elTi : ioss.getTaSeng().getElTisList()) {
            process(elTi.getKerbu().getClagis().get(0).getWeHusot().getScos().getTrases().get(0).getBiank().getCici());
        }
    }

Related puzzles: