Class relationships: Correct Solution


Consider the follow class declarations:

public class AcaRass {
    public Solac getEdDoheu() {
        ...
    }

    public String getSirn() {
        ...
    }

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

public class Bleght {
    public Ciossfu getZiode() {
        ...
    }

    public File getPhel() {
        ...
    }
}

public class CedLon {
    public List<MioTrengtou> getComins() {
        ...
    }

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

public class Ciossfu {
    public File getAdEriol() {
        ...
    }
}

public class Cossses extends Tuall {
    public Rimwhar getRetso() {
        ...
    }
}

public class EesPsos {
    public Octnod getEdil() {
        ...
    }

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

public class Grosmtas extends Ripou {
    public List<EesPsos> getBigses() {
        ...
    }

    public Irstust getWiTet() {
        ...
    }
}

public class Haehue {
    public List<CedLon> getSlus() {
        ...
    }

    public Cossses getCuc() {
        ...
    }
}

public class Harplun {
    public int getThova() {
        ...
    }
}

public class Irstust extends Totil {
    public int getMect() {
        ...
    }
}

public class Lilpten extends AcaRass {
    public int getTiss() {
        ...
    }
}

public class MioTrengtou {
    public byte[] getIses() {
        ...
    }
}

public class Molkion extends Haehue {
    public Harplun getSoIc() {
        ...
    }

    public Trar getTebe() {
        ...
    }
}

public class Octnod {
    public byte[] getDimor() {
        ...
    }
}

public class Prawress extends PsaLollme {
    public File getChri() {
        ...
    }
}

public class PsaLollme {
    public int getStrin() {
        ...
    }

    public List<Stunged> getHonths() {
        ...
    }
}

public class Rimwhar {
    public int getAdgac() {
        ...
    }

    public List<Prawress> getMiths() {
        ...
    }
}

public class Ripou {
    public int getCiOt() {
        ...
    }
}

public class Solac {
    public List<String> getMic() {
        ...
    }
}

public class Stunged {
    public Lilpten getFePa() {
        ...
    }

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

public class Tarid {
    public File getSeIrus() {
        ...
    }

    public List<Molkion> getIalms() {
        ...
    }
}

public class Totil {
    public List<Tarid> getOuSmirs() {
        ...
    }

    public List<Bleght> getOrises() {
        ...
    }
}

public class Trar {
    public String getSiul() {
        ...
    }
}

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

    Grosmtas au

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the jopra of each honth of the first mith of the first ialm of the first ouSmir of au.

    Solution

    for (Tarid ouSmir : au.getWiTet().getTotil().getOuSmirsList()) {
        for (Molkion ialm : ouSmir.getIalmsList()) {
            for (Prawress mith : ialm.getHaehue().getCuc().getRetso().getMithsList()) {
                process(mith.getPsaLollme().getHonths().get(0).getFePa().getAcaRass().getJopra());
            }
        }
    }

Related puzzles: