Class relationships: Correct Solution


Consider the follow class declarations:

public class Aiss {
    public List<Wreflac> getCeis() {
        ...
    }

    public String getPaOprec() {
        ...
    }
}

public class Becfo extends Phentkles {
    public int getRhou() {
        ...
    }
}

public class Cruna {
    public List<String> getSefar() {
        ...
    }
}

public class Daenfu {
    public byte[] getAdXirad() {
        ...
    }
}

public class Dairbo extends Kioun {
    public File getOsSiod() {
        ...
    }
}

public class Dipu {
    public byte[] getGrur() {
        ...
    }
}

public class Doid {
    public List<Psimgism> getCorfas() {
        ...
    }

    public List<SqoWucril> getMaMics() {
        ...
    }

    public List<Daenfu> getPrious() {
        ...
    }

    public Hiwn getVapet() {
        ...
    }
}

public class Estso {
    public List<Dairbo> getSeteses() {
        ...
    }

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

public class Hiwn extends Estso {
    public Vufes getEdIbber() {
        ...
    }
}

public class Iloss {
    public File getIsla() {
        ...
    }

    public Becfo getNiHospi() {
        ...
    }
}

public class Kioun {
    public Aiss getSaCu() {
        ...
    }

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

public class OssGipult {
    public String getMiLos() {
        ...
    }
}

public class Peirsos {
    public byte[] getJas() {
        ...
    }
}

public class Phentkles extends Dipu {
    public List<Doid> getBiqas() {
        ...
    }
}

public class Psimgism {
    public String getCehid() {
        ...
    }
}

public class Seidurd extends OssGipult {
    public int getPlo() {
        ...
    }

    public String getPuCrosu() {
        ...
    }
}

public class SqoWucril {
    public Peirsos getEsde() {
        ...
    }

    public Ubros getUdLazep() {
        ...
    }
}

public class Ubros {
    public String getAdae() {
        ...
    }
}

public class Vufes {
    public int getPiis() {
        ...
    }
}

public class Wreflac {
    public List<Seidurd> getEnts() {
        ...
    }

    public Cruna getPhux() {
        ...
    }
}
  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:

    Iloss eong

    ...and the following method:

    public void process(String item)

    ...write code to process the puCrosu of the first ent of the first cei of each setes of each biqa of eong.

    Solution

    for (Wreflac cei : eong.getNiHospi().getPhentkles().getBiqas().get(0).getVapet().getEstso().getSeteses().get(0).getKioun().getSaCu().getCeisList()) {
        for (Seidurd ent : cei.getEntsList()) {
            process(ent.getPuCrosu());
        }
    }

Related puzzles: