Class relationships: Correct Solution


Consider the follow class declarations:

public class Arthe extends Vednin {
    public List<Ethcea> getTrors() {
        ...
    }

    public Bisish getOss() {
        ...
    }

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

public class Bisish {
    public byte[] getOcWriac() {
        ...
    }
}

public class Ciassoc {
    public File getRiNe() {
        ...
    }
}

public class Cresmio {
    public byte[] getTenmo() {
        ...
    }
}

public class Cridpsec {
    public Pesmmor getNala() {
        ...
    }

    public List<Sesza> getEnins() {
        ...
    }
}

public class Ecen {
    public String getEloss() {
        ...
    }

    public Tengpo getLuen() {
        ...
    }
}

public class Ersi {
    public Ocksoft getEack() {
        ...
    }

    public int getBuis() {
        ...
    }
}

public class Ethcea {
    public int getWamer() {
        ...
    }
}

public class Fengeou {
    public List<OllHias> getQolars() {
        ...
    }

    public String getPhimo() {
        ...
    }
}

public class Gresnick extends SpeSphistvoo {
    public List<Ciassoc> getUnts() {
        ...
    }

    public Pictoss getOsOd() {
        ...
    }
}

public class Gric extends Pacbo {
    public Selmin getOpion() {
        ...
    }
}

public class Issbee {
    public String getNoElco() {
        ...
    }
}

public class Mierbion {
    public List<String> getHiHih() {
        ...
    }
}

public class Ocksoft extends Fengeou {
    public Cresmio getUcla() {
        ...
    }

    public List<Issbee> getNeces() {
        ...
    }
}

public class OllHias {
    public List<Ecen> getMisms() {
        ...
    }

    public File getSont() {
        ...
    }
}

public class Pacbo {
    public int getIoci() {
        ...
    }
}

public class Pesmmor {
    public List<Gresnick> getIbCerms() {
        ...
    }

    public Mierbion getHetha() {
        ...
    }
}

public class Pictoss {
    public byte[] getShoc() {
        ...
    }
}

public class Selmin extends Arthe {
    public File getBusas() {
        ...
    }
}

public class Sesza {
    public File getSpil() {
        ...
    }
}

public class SpeSphistvoo {
    public List<Whonbroin> getEaRhols() {
        ...
    }

    public List<Gric> getOics() {
        ...
    }
}

public class Tengpo extends Cridpsec {
    public String getPio() {
        ...
    }
}

public class Vednin {
    public byte[] getDecni() {
        ...
    }
}

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

    Ersi ulin

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the iltil of the first oic of the first ibCerm of each mism of each qolar of ulin.

    Solution

    for (Gresnick ibCerm : ulin.getEack().getFengeou().getQolars().get(0).getMisms().get(0).getLuen().getCridpsec().getNala().getIbCermsList()) {
        for (Gric oic : ibCerm.getSpeSphistvoo().getOicsList()) {
            process(oic.getOpion().getArthe().getIltil());
        }
    }

Related puzzles: