Class relationships: Correct Solution


Consider the follow class declarations:

public class AiiZestrit {
    public int getBuPlo() {
        ...
    }
}

public class Aspra extends SwiMerdshis {
    public Rarhir getFaNiod() {
        ...
    }

    public Hopim getDiir() {
        ...
    }
}

public class Banchas {
    public byte[] getRaho() {
        ...
    }

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

public class Ceestac {
    public String getCoIc() {
        ...
    }

    public Eocsa getHodo() {
        ...
    }
}

public class Ealchu {
    public Lacill getJes() {
        ...
    }

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

public class Eocsa {
    public File getWred() {
        ...
    }
}

public class Hiosh extends Ceestac {
    public List<Mebea> getRijacs() {
        ...
    }
}

public class Hopim extends AiiZestrit {
    public List<String> getNedbe() {
        ...
    }
}

public class Ieko {
    public List<String> getJoCe() {
        ...
    }
}

public class Lacill {
    public String getPou() {
        ...
    }

    public List<Snissmut> getCocs() {
        ...
    }
}

public class Mebea {
    public List<Ziag> getPlucs() {
        ...
    }

    public Banchas getSpoi() {
        ...
    }
}

public class Nosm {
    public byte[] getRaiti() {
        ...
    }

    public Sest getCuHe() {
        ...
    }
}

public class Rarhir {
    public String getInCloi() {
        ...
    }
}

public class Sest extends Hiosh {
    public byte[] getLio() {
        ...
    }
}

public class Snissmut extends Nosm {
    public int getIotpa() {
        ...
    }
}

public class SwiMerdshis {
    public List<Ulki> getMaings() {
        ...
    }

    public List<Ealchu> getPehes() {
        ...
    }
}

public class Tross {
    public byte[] getMioc() {
        ...
    }

    public Aspra getLarti() {
        ...
    }
}

public class Trunoph {
    public List<String> getDeRi() {
        ...
    }
}

public class Ulki {
    public String getSaCadid() {
        ...
    }
}

public class Ziag extends Ieko {
    public List<Trunoph> getHoants() {
        ...
    }
}
  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:

    Tross gea

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the stehi of each rijac of the first coc of each pehe of gea.

    Solution

    for (Snissmut coc : gea.getLarti().getSwiMerdshis().getPehes().get(0).getJes().getCocsList()) {
        process(coc.getNosm().getCuHe().getHiosh().getRijacs().get(0).getSpoi().getStehi());
    }

Related puzzles: