Class relationships: Correct Solution


Consider the follow class declarations:

public class BieRean {
    public File getDax() {
        ...
    }
}

public class BruPouaur extends CocMic {
    public String getElce() {
        ...
    }
}

public class Choei extends FeaPhasod {
    public byte[] getAmsen() {
        ...
    }
}

public class CimIlsqoo {
    public int getPecgi() {
        ...
    }
}

public class CocMic extends BieRean {
    public Ipre getBioul() {
        ...
    }
}

public class Diossa {
    public List<String> getEcast() {
        ...
    }

    public Glecock getScezi() {
        ...
    }
}

public class EshIrbof {
    public List<Qispsa> getVishs() {
        ...
    }

    public List<Morui> getEssas() {
        ...
    }

    public List<Soulwa> getSeleses() {
        ...
    }
}

public class FeaPhasod {
    public List<Ongdards> getSearms() {
        ...
    }

    public String getSkion() {
        ...
    }
}

public class Flant {
    public byte[] getBiwi() {
        ...
    }
}

public class Glecock {
    public List<EshIrbof> getScirs() {
        ...
    }

    public Flant getSwu() {
        ...
    }
}

public class Ipre {
    public String getMiwn() {
        ...
    }

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

public class Missduc {
    public List<String> getNeph() {
        ...
    }
}

public class Morui {
    public OrmTemdoc getAsCorha() {
        ...
    }

    public int getWuPo() {
        ...
    }
}

public class Nosmhio {
    public String getRapam() {
        ...
    }
}

public class Onci {
    public File getSela() {
        ...
    }
}

public class Ongdards extends Diossa {
    public CimIlsqoo getIco() {
        ...
    }
}

public class OrmTemdoc {
    public byte[] getUnRe() {
        ...
    }
}

public class Prui extends BruPouaur {
    public List<Onci> getDaends() {
        ...
    }
}

public class Qispsa extends RerTrelle {
    public File getHoCassa() {
        ...
    }
}

public class RerTrelle {
    public byte[] getIcai() {
        ...
    }

    public List<Missduc> getHopas() {
        ...
    }
}

public class Soulwa {
    public Prui getIler() {
        ...
    }

    public Nosmhio getGint() {
        ...
    }
}

public class Sprud {
    public Choei getTresm() {
        ...
    }

    public File getFaga() {
        ...
    }
}
  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:

    Sprud essu

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the ipad of the first seles of each scir of the first searm of essu.

    Solution

    for (Ongdards searm : essu.getTresm().getFeaPhasod().getSearmsList()) {
        for (Soulwa seles : searm.getDiossa().getScezi().getScirs().get(0).getSelesesList()) {
            process(seles.getIler().getBruPouaur().getCocMic().getBioul().getIpad());
        }
    }

Related puzzles: