Class relationships: Correct Solution


Consider the follow class declarations:

public class Bichau extends Pedor {
    public List<String> getBle() {
        ...
    }
}

public class Ceio {
    public File getLusdo() {
        ...
    }
}

public class Cesh {
    public List<String> getDedcu() {
        ...
    }
}

public class Dadmoc {
    public File getOcson() {
        ...
    }
}

public class Didi extends Ulcasm {
    public List<Ioasm> getSoues() {
        ...
    }
}

public class Ganzos {
    public File getCaSiu() {
        ...
    }
}

public class Ibact {
    public Tiasmrorn getXash() {
        ...
    }

    public int getJeco() {
        ...
    }
}

public class Impoang {
    public List<Bichau> getZids() {
        ...
    }

    public String getMup() {
        ...
    }
}

public class Ioasm extends Thicbracs {
    public int getRuSo() {
        ...
    }
}

public class Nomsong {
    public List<Tiacs> getOcrels() {
        ...
    }

    public List<Ibact> getRhomis() {
        ...
    }
}

public class Pedor extends Rangva {
    public int getEcIpe() {
        ...
    }

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

public class Rangva {
    public List<String> getEehir() {
        ...
    }
}

public class RerTuing {
    public File getUer() {
        ...
    }

    public Didi getBeCassa() {
        ...
    }
}

public class Sciru {
    public byte[] getPra() {
        ...
    }
}

public class Shaplass extends Impoang {
    public int getPlapa() {
        ...
    }
}

public class Thicbracs extends Nomsong {
    public Dadmoc getSiAstou() {
        ...
    }

    public List<Tostsi> getPiEmtecs() {
        ...
    }
}

public class Tiacs {
    public List<Cesh> getOrtous() {
        ...
    }

    public String getPhia() {
        ...
    }
}

public class Tiasmrorn {
    public Ceio getSisdi() {
        ...
    }

    public Shaplass getDuPla() {
        ...
    }
}

public class Tostsi {
    public Ganzos getLeLoio() {
        ...
    }

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

public class Ulcasm {
    public String getScas() {
        ...
    }

    public List<Sciru> getTidsis() {
        ...
    }
}
  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:

    RerTuing om

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the riAgan of the first zid of the first rhomi of the first soue of om.

    Solution

    for (Ioasm soue : om.getBeCassa().getSouesList()) {
        for (Ibact rhomi : soue.getThicbracs().getNomsong().getRhomisList()) {
            for (Bichau zid : rhomi.getXash().getDuPla().getImpoang().getZidsList()) {
                process(zid.getPedor().getRiAgan());
            }
        }
    }

Related puzzles: