Class relationships: Correct Solution


Consider the follow class declarations:

public class Brael {
    public String getMiup() {
        ...
    }
}

public class CipIdun {
    public List<Taras> getBiRodis() {
        ...
    }

    public String getOnCle() {
        ...
    }
}

public class Clesh {
    public int getIss() {
        ...
    }
}

public class Cousmcol {
    public int getEnia() {
        ...
    }
}

public class Duiddoc extends Brael {
    public byte[] getIlPren() {
        ...
    }
}

public class Eeth {
    public List<Toithow> getCeNolpas() {
        ...
    }

    public String getPeang() {
        ...
    }
}

public class Guprar {
    public byte[] getAdus() {
        ...
    }
}

public class Hean extends Ismou {
    public List<Clesh> getNals() {
        ...
    }
}

public class Hiouc {
    public List<Hean> getHocsas() {
        ...
    }

    public File getJever() {
        ...
    }
}

public class Ismou extends Cousmcol {
    public Eeth getArPu() {
        ...
    }
}

public class Makrad {
    public byte[] getEur() {
        ...
    }
}

public class Masi extends Pradip {
    public Uptbell getCear() {
        ...
    }

    public Duiddoc getTulod() {
        ...
    }

    public Makrad getCavan() {
        ...
    }
}

public class Pradip {
    public List<Guprar> getGuirs() {
        ...
    }

    public List<CipIdun> getLenfes() {
        ...
    }
}

public class Robo {
    public List<String> getTiLo() {
        ...
    }
}

public class Sutes extends Ugen {
    public List<Robo> getNaIrs() {
        ...
    }

    public Masi getIlgal() {
        ...
    }
}

public class Taras extends Wautlous {
    public File getMemus() {
        ...
    }
}

public class Toithow {
    public int getDri() {
        ...
    }

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

public class Ugen {
    public byte[] getIasse() {
        ...
    }
}

public class Uptbell {
    public File getSnai() {
        ...
    }
}

public class Wautlous {
    public Hiouc getSquc() {
        ...
    }

    public byte[] getEdCusai() {
        ...
    }
}
  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:

    Sutes tir

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the ent of the first ceNolpa of each hocsa of the first biRodi of each lenfe of tir.

    Solution

    for (Taras biRodi : tir.getIlgal().getPradip().getLenfes().get(0).getBiRodisList()) {
        for (Toithow ceNolpa : biRodi.getWautlous().getSquc().getHocsas().get(0).getIsmou().getArPu().getCeNolpasList()) {
            process(ceNolpa.getEnt());
        }
    }

Related puzzles: