Class relationships: Correct Solution


Consider the follow class declarations:

public class Amreap {
    public Brerrou getSchal() {
        ...
    }

    public int getCiseh() {
        ...
    }
}

public class Brerrou extends Singple {
    public List<Ealgra> getPocnis() {
        ...
    }
}

public class Cichlian {
    public String getRanco() {
        ...
    }

    public Stai getStiam() {
        ...
    }
}

public class Culir {
    public int getIaDonad() {
        ...
    }
}

public class DedDaen {
    public List<Iarzin> getPlonds() {
        ...
    }

    public List<Pida> getIsBus() {
        ...
    }
}

public class Ealgra extends Cichlian {
    public String getBoash() {
        ...
    }
}

public class FelElell extends Herme {
    public Puld getPiotz() {
        ...
    }

    public Culir getLoPedi() {
        ...
    }

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

public class Foint {
    public Ponmau getIrFixas() {
        ...
    }

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

public class GecIsned extends Foint {
    public int getTiSeng() {
        ...
    }
}

public class Groo {
    public List<Phloibom> getSoswos() {
        ...
    }

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

public class Herme {
    public String getRelki() {
        ...
    }
}

public class Iarzin {
    public File getSodis() {
        ...
    }
}

public class Onprith {
    public int getCuPhint() {
        ...
    }
}

public class Phloibom extends Amreap {
    public List<DedDaen> getSoists() {
        ...
    }
}

public class Pida {
    public String getMaou() {
        ...
    }
}

public class Ponmau {
    public List<String> getBrene() {
        ...
    }

    public List<FelElell> getMiols() {
        ...
    }
}

public class Puld {
    public int getTeBrer() {
        ...
    }
}

public class Singple {
    public List<String> getEoEs() {
        ...
    }
}

public class Stai {
    public Trenpse getGicho() {
        ...
    }

    public List<GecIsned> getVonsis() {
        ...
    }
}

public class Trenpse {
    public int getVerne() {
        ...
    }

    public Onprith getPlun() {
        ...
    }
}
  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:

    Groo duip

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the ossba of the first miol of each vonsi of each pocni of each soswo of duip.

    Solution

    for (FelElell miol : duip.getSoswos().get(0).getAmreap().getSchal().getPocnis().get(0).getCichlian().getStiam().getVonsis().get(0).getFoint().getIrFixas().getMiolsList()) {
        process(miol.getOssba());
    }

Related puzzles: