Class relationships: Correct Solution


Consider the follow class declarations:

public class Angmel {
    public Racvo getBic() {
        ...
    }

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

public class Aucbers {
    public List<String> getOdPe() {
        ...
    }
}

public class Ausoud {
    public int getUlged() {
        ...
    }
}

public class Begres {
    public List<String> getUssti() {
        ...
    }

    public Idvo getBaScli() {
        ...
    }

    public String getPaHa() {
        ...
    }
}

public class Chianlong extends Ockda {
    public List<Schi> getPiKoos() {
        ...
    }

    public List<Piour> getBeUls() {
        ...
    }
}

public class Ennost {
    public Begres getElPhing() {
        ...
    }

    public String getPhier() {
        ...
    }
}

public class HaaPel {
    public int getMuHiae() {
        ...
    }

    public Ennost getNeuc() {
        ...
    }
}

public class Idvo {
    public File getKec() {
        ...
    }
}

public class JorDoco extends Toveght {
    public int getOmor() {
        ...
    }
}

public class Kipass {
    public Sest getKipas() {
        ...
    }

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

public class Ockda {
    public String getRoIdod() {
        ...
    }
}

public class Piour {
    public List<String> getRhiwn() {
        ...
    }

    public List<Angmel> getCoBesocs() {
        ...
    }
}

public class Pranve {
    public List<Ausoud> getMasms() {
        ...
    }

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

public class Preal extends Chianlong {
    public List<Viress> getTePnas() {
        ...
    }
}

public class Racvo {
    public byte[] getJiTreeo() {
        ...
    }
}

public class Roseld extends Kipass {
    public byte[] getOskna() {
        ...
    }
}

public class Schi extends Pranve {
    public JorDoco getCiar() {
        ...
    }
}

public class Sest {
    public File getPoal() {
        ...
    }

    public List<Preal> getUoses() {
        ...
    }
}

public class Toveght {
    public List<HaaPel> getFics() {
        ...
    }

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

public class Viress extends Aucbers {
    public List<String> getHeam() {
        ...
    }
}
  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:

    Roseld cleo

    ...and the following method:

    public void process(String item)

    ...write code to process the paHa of the first fic of the first piKoo of each uos of cleo.

    Solution

    for (Schi piKoo : cleo.getKipass().getKipas().getUoses().get(0).getChianlong().getPiKoosList()) {
        for (HaaPel fic : piKoo.getCiar().getToveght().getFicsList()) {
            process(fic.getNeuc().getElPhing().getPaHa());
        }
    }

Related puzzles: