Class relationships: Correct Solution


Consider the follow class declarations:

public class Armhind {
    public String getZeda() {
        ...
    }

    public List<Qonen> getVitirs() {
        ...
    }
}

public class BiaPsesa extends Penjo {
    public Splu getDul() {
        ...
    }

    public List<Stas> getPradas() {
        ...
    }
}

public class Bitem {
    public Usid getTrunt() {
        ...
    }

    public Armhind getHif() {
        ...
    }
}

public class Buing {
    public File getMeEn() {
        ...
    }

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

public class Craper extends BiaPsesa {
    public File getSiIac() {
        ...
    }
}

public class Daen {
    public int getOnde() {
        ...
    }
}

public class Decsi {
    public Bitem getMaca() {
        ...
    }

    public int getGuzz() {
        ...
    }
}

public class EolSprus {
    public List<Irong> getTeacs() {
        ...
    }

    public List<NocRorpe> getBeLas() {
        ...
    }

    public List<Kass> getPomces() {
        ...
    }
}

public class Eust {
    public String getIlQal() {
        ...
    }
}

public class Idchias extends Rosbra {
    public byte[] getIsKocom() {
        ...
    }
}

public class Irong {
    public int getBiEntes() {
        ...
    }
}

public class Kass {
    public int getCeEo() {
        ...
    }
}

public class Niom {
    public File getEdKlos() {
        ...
    }
}

public class NocRorpe {
    public Craper getDeZo() {
        ...
    }

    public File getPhord() {
        ...
    }
}

public class Omcan {
    public int getCoTir() {
        ...
    }
}

public class Outt extends Niom {
    public int getFlou() {
        ...
    }
}

public class Penjo {
    public byte[] getStiem() {
        ...
    }
}

public class Qecthour {
    public File getSpon() {
        ...
    }

    public List<Decsi> getAnOms() {
        ...
    }
}

public class Qonen extends Buing {
    public byte[] getMeden() {
        ...
    }
}

public class Rissi {
    public Daen getSaWi() {
        ...
    }

    public String getCou() {
        ...
    }
}

public class Rosbra extends Qecthour {
    public Eust getPibre() {
        ...
    }

    public List<Outt> getFededs() {
        ...
    }
}

public class Splu {
    public int getEcel() {
        ...
    }
}

public class Stas {
    public File getAtrel() {
        ...
    }

    public Idchias getPrus() {
        ...
    }
}

public class Usid extends Rissi {
    public List<Omcan> getEntas() {
        ...
    }
}
  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:

    EolSprus eul

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the losin of the first vitir of the first anOm of each prada of each beLa of eul.

    Solution

    for (Decsi anOm : eul.getBeLas().get(0).getDeZo().getBiaPsesa().getPradas().get(0).getPrus().getRosbra().getQecthour().getAnOmsList()) {
        for (Qonen vitir : anOm.getMaca().getHif().getVitirsList()) {
            process(vitir.getBuing().getLosin());
        }
    }

Related puzzles: