Class relationships: Correct Solution


Consider the follow class declarations:

public class Aspor extends Sclell {
    public Vioess getProsi() {
        ...
    }
}

public class Clibel extends Rocril {
    public List<Aspor> getOntpos() {
        ...
    }
}

public class EesPeden extends Nusmi {
    public List<String> getUrCiang() {
        ...
    }
}

public class Geson {
    public File getSce() {
        ...
    }
}

public class Isde {
    public Splod getSamu() {
        ...
    }

    public List<EesPeden> getUaDiis() {
        ...
    }
}

public class IsiBeanun {
    public int getPaUcpe() {
        ...
    }
}

public class Isslen extends Lodsnust {
    public Leckruell getIsAhar() {
        ...
    }
}

public class Kastant {
    public List<Geson> getNeases() {
        ...
    }

    public List<Isde> getPobis() {
        ...
    }
}

public class Leckruell {
    public String getMirha() {
        ...
    }
}

public class Lodsnust {
    public Clibel getIwui() {
        ...
    }

    public String getInel() {
        ...
    }
}

public class Nusmi extends Vish {
    public File getIcpre() {
        ...
    }

    public File getMepre() {
        ...
    }
}

public class Rocril {
    public String getIende() {
        ...
    }

    public List<IsiBeanun> getEspsos() {
        ...
    }
}

public class Sclell {
    public List<String> getIlsel() {
        ...
    }

    public Kastant getAlOc() {
        ...
    }
}

public class Splod {
    public int getCiol() {
        ...
    }
}

public class Vioess {
    public int getAtbi() {
        ...
    }
}

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

    Isslen diro

    ...and the following method:

    public void process(File item)

    ...write code to process the mepre of the first uaDii of each pobi of each ontpo of diro.

    Solution

    for (EesPeden uaDii : diro.getLodsnust().getIwui().getOntpos().get(0).getSclell().getAlOc().getPobis().get(0).getUaDiisList()) {
        process(uaDii.getNusmi().getMepre());
    }

Related puzzles: