Class relationships: Correct Solution


Consider the follow class declarations:

public class Affstri extends Onta {
    public String getErmu() {
        ...
    }
}

public class Aung {
    public List<Affstri> getSohes() {
        ...
    }

    public String getNount() {
        ...
    }
}

public class Brel extends Pecphan {
    public List<String> getNiDu() {
        ...
    }
}

public class Ciren {
    public File getEro() {
        ...
    }
}

public class Dadin {
    public String getCesol() {
        ...
    }
}

public class Deloh extends Lotmar {
    public List<Rezil> getPras() {
        ...
    }
}

public class Dodchea {
    public byte[] getTre() {
        ...
    }
}

public class EtiSicos {
    public List<Ciren> getThiwos() {
        ...
    }

    public List<Phaloist> getUcuis() {
        ...
    }
}

public class Forbion extends Deloh {
    public Itglier getWisid() {
        ...
    }

    public Dadin getKes() {
        ...
    }
}

public class Geaff {
    public int getIcba() {
        ...
    }
}

public class Itglier {
    public int getCint() {
        ...
    }
}

public class Lotmar {
    public byte[] getActil() {
        ...
    }

    public Maeon getVaea() {
        ...
    }
}

public class Maeon {
    public List<Aung> getOePhens() {
        ...
    }

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

public class MurOrdias {
    public List<String> getLeCeb() {
        ...
    }
}

public class Onta {
    public Brel getIsi() {
        ...
    }

    public Dodchea getNic() {
        ...
    }

    public Paudiong getHeKusm() {
        ...
    }
}

public class Paudiong {
    public List<Geaff> getMitzs() {
        ...
    }

    public List<MurOrdias> getBlaias() {
        ...
    }

    public Tardost getKool() {
        ...
    }
}

public class Pecphan {
    public byte[] getCloie() {
        ...
    }

    public File getCheil() {
        ...
    }
}

public class Phaloist {
    public Forbion getSanva() {
        ...
    }

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

public class Rezil {
    public File getRebe() {
        ...
    }
}

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

    EtiSicos ving

    ...and the following method:

    public void process(File item)

    ...write code to process the cheil of the first sohe of the first oePhen of each ucui of ving.

    Solution

    for (Aung oePhen : ving.getUcuis().get(0).getSanva().getDeloh().getLotmar().getVaea().getOePhensList()) {
        for (Affstri sohe : oePhen.getSohesList()) {
            process(sohe.getOnta().getIsi().getPecphan().getCheil());
        }
    }

Related puzzles: