Class relationships: Correct Solution


Consider the follow class declarations:

public class AngEfac {
    public int getRhi() {
        ...
    }
}

public class Cange {
    public String getUngos() {
        ...
    }
}

public class Casod extends Didis {
    public List<Knid> getFodos() {
        ...
    }
}

public class Chaqin {
    public Socu getTocma() {
        ...
    }

    public File getMowei() {
        ...
    }
}

public class Cranfrouc extends Puaman {
    public Prephod getIlPrert() {
        ...
    }
}

public class Didis extends Hica {
    public List<Lacuc> getGiOls() {
        ...
    }
}

public class Enost {
    public Pudhor getRiad() {
        ...
    }

    public File getBefed() {
        ...
    }
}

public class Hica {
    public File getCenga() {
        ...
    }
}

public class Knid {
    public List<String> getTendi() {
        ...
    }

    public AngEfac getCoc() {
        ...
    }
}

public class Lacuc extends Enost {
    public int getCeoss() {
        ...
    }
}

public class OcuAses {
    public byte[] getPsep() {
        ...
    }
}

public class Omsen {
    public byte[] getDaSchi() {
        ...
    }
}

public class Prephod {
    public int getMoDotch() {
        ...
    }
}

public class Puaman extends Omsen {
    public Qapod getQint() {
        ...
    }

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

public class Pudhor {
    public List<Purpe> getVardes() {
        ...
    }

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

public class Purpe {
    public List<Whessas> getEnViszes() {
        ...
    }

    public OcuAses getSeIsren() {
        ...
    }
}

public class Qapod {
    public List<Ruro> getCases() {
        ...
    }

    public List<Cange> getGassos() {
        ...
    }
}

public class Ruro {
    public int getIdScru() {
        ...
    }
}

public class Siche {
    public String getPhist() {
        ...
    }

    public Casod getCirds() {
        ...
    }
}

public class Socu {
    public Thid getVePri() {
        ...
    }

    public List<Cranfrouc> getTirns() {
        ...
    }
}

public class Thid {
    public String getCic() {
        ...
    }
}

public class Whessas extends Chaqin {
    public File getEnma() {
        ...
    }
}
  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:

    Siche wia

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the cepo of each tirn of the first enVisze of each varde of each giOl of wia.

    Solution

    for (Whessas enVisze : wia.getCirds().getDidis().getGiOls().get(0).getEnost().getRiad().getVardes().get(0).getEnViszesList()) {
        process(enVisze.getChaqin().getTocma().getTirns().get(0).getPuaman().getCepo());
    }

Related puzzles: