Class relationships: Correct Solution


Consider the follow class declarations:

public class Adesm {
    public int getCism() {
        ...
    }
}

public class Assposs {
    public String getUsplu() {
        ...
    }
}

public class Bedmiad {
    public List<Orlcen> getOaps() {
        ...
    }

    public String getCiNiss() {
        ...
    }
}

public class Cena extends Adesm {
    public int getCripu() {
        ...
    }

    public String getInMeral() {
        ...
    }
}

public class Chrapte {
    public int getFeong() {
        ...
    }
}

public class Cridgrir {
    public String getPlao() {
        ...
    }
}

public class Dokked extends Hiuc {
    public int getPra() {
        ...
    }
}

public class Glesstot {
    public byte[] getIrtes() {
        ...
    }
}

public class Hiuc {
    public Malen getDibin() {
        ...
    }

    public List<Chrapte> getNiuns() {
        ...
    }

    public List<Glesstot> getFigers() {
        ...
    }
}

public class IorEnard {
    public int getNoow() {
        ...
    }

    public List<Pecre> getPiMes() {
        ...
    }
}

public class Malen {
    public List<String> getUph() {
        ...
    }

    public List<Pirsou> getRars() {
        ...
    }
}

public class Melpher extends Cena {
    public byte[] getMaPri() {
        ...
    }
}

public class Orlcen extends Rurnca {
    public int getAnge() {
        ...
    }
}

public class Pecre extends Peplur {
    public int getCeni() {
        ...
    }
}

public class Peplur {
    public Vong getKict() {
        ...
    }

    public SuaDioltid getDucbo() {
        ...
    }
}

public class Pirsou extends Ploved {
    public Sermsmes getPlaen() {
        ...
    }
}

public class Ploved {
    public Bedmiad getQaGiuw() {
        ...
    }

    public List<Strarcen> getSests() {
        ...
    }
}

public class Rurnca {
    public List<Assposs> getSocis() {
        ...
    }

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

public class Sermsmes {
    public int getPusan() {
        ...
    }
}

public class Strarcen {
    public List<String> getWhe() {
        ...
    }

    public IorEnard getMoJe() {
        ...
    }
}

public class SuaDioltid extends Cridgrir {
    public Melpher getEoud() {
        ...
    }
}

public class Vong {
    public int getVaEl() {
        ...
    }
}
  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:

    Dokked ol

    ...and the following method:

    public void process(String item)

    ...write code to process the inMeral of the first piMe of each sest of each rar of ol.

    Solution

    for (Pecre piMe : ol.getHiuc().getDibin().getRars().get(0).getPloved().getSests().get(0).getMoJe().getPiMesList()) {
        process(piMe.getPeplur().getDucbo().getEoud().getCena().getInMeral());
    }

Related puzzles: