Class relationships: Correct Solution


Consider the follow class declarations:

public class Alsa extends Lollhos {
    public List<Cirdiap> getEspas() {
        ...
    }

    public List<DicPrewha> getNoEacs() {
        ...
    }

    public List<Stiscle> getTuives() {
        ...
    }

    public Odson getWiOnhil() {
        ...
    }
}

public class Cashie {
    public List<Woirvi> getEpes() {
        ...
    }

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

public class Cierdsen {
    public String getFlei() {
        ...
    }
}

public class Cirdiap {
    public byte[] getPhic() {
        ...
    }
}

public class Cogol {
    public List<String> getPtas() {
        ...
    }
}

public class DicPrewha {
    public int getSni() {
        ...
    }
}

public class Dosmann {
    public byte[] getHeTuc() {
        ...
    }

    public File getBeli() {
        ...
    }
}

public class EbiCim {
    public Ront getIliss() {
        ...
    }

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

public class Lollhos {
    public Vont getRaOod() {
        ...
    }

    public String getMiPe() {
        ...
    }
}

public class Medan {
    public RorOsporm getIlsi() {
        ...
    }

    public String getLeMonan() {
        ...
    }
}

public class Mingso {
    public File getOuPi() {
        ...
    }
}

public class Odson {
    public List<String> getEcEt() {
        ...
    }
}

public class Prif extends Cogol {
    public List<QadPembe> getKeWuuas() {
        ...
    }
}

public class QadPembe {
    public byte[] getEnSuad() {
        ...
    }
}

public class Ront extends Alsa {
    public File getThomo() {
        ...
    }
}

public class RorOsporm {
    public List<Siadless> getPeis() {
        ...
    }

    public Mingso getNegri() {
        ...
    }
}

public class Shrist extends Medan {
    public File getPlel() {
        ...
    }
}

public class Siadless extends Sicjird {
    public File getEscac() {
        ...
    }
}

public class Sicjird {
    public int getHiean() {
        ...
    }

    public Cashie getDualo() {
        ...
    }
}

public class Stiscle extends Prif {
    public Dosmann getReNi() {
        ...
    }
}

public class Vont extends Cierdsen {
    public File getTaZau() {
        ...
    }
}

public class Woirvi {
    public byte[] getGeIe() {
        ...
    }

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

    Shrist ci

    ...and the following method:

    public void process(File item)

    ...write code to process the beli of each tuive of the first ioSe of the first epe of each pei of ci.

    Solution

    for (Woirvi epe : ci.getMedan().getIlsi().getPeis().get(0).getSicjird().getDualo().getEpesList()) {
        for (EbiCim ioSe : epe.getIoSesList()) {
            process(ioSe.getIliss().getAlsa().getTuives().get(0).getReNi().getBeli());
        }
    }

Related puzzles: