Class relationships: Correct Solution


Consider the follow class declarations:

public class Alluac {
    public List<Musm> getMipols() {
        ...
    }

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

public class BreSosprash {
    public byte[] getOdded() {
        ...
    }
}

public class Ceek {
    public String getCesh() {
        ...
    }

    public List<Cengel> getNeClises() {
        ...
    }
}

public class Cengel extends Rewran {
    public Enteuss getBlaro() {
        ...
    }

    public Rioul getXaca() {
        ...
    }
}

public class Chiachlar extends Enial {
    public Ciantgic getChiss() {
        ...
    }
}

public class Ciantgic {
    public int getEnte() {
        ...
    }
}

public class Elstir {
    public List<Chiachlar> getNinkas() {
        ...
    }

    public Alluac getTeCudan() {
        ...
    }
}

public class Enial {
    public List<String> getRaSeneo() {
        ...
    }
}

public class Enteuss {
    public int getPaItmid() {
        ...
    }
}

public class Etviss extends PtoGehi {
    public List<Ourxa> getEiarks() {
        ...
    }
}

public class Feni extends Narnes {
    public List<Elstir> getKaIors() {
        ...
    }
}

public class LauPlessti {
    public byte[] getErsol() {
        ...
    }
}

public class Musm extends Phatac {
    public File getUsmad() {
        ...
    }
}

public class Narnes {
    public List<String> getTia() {
        ...
    }
}

public class Odeuct {
    public File getUane() {
        ...
    }
}

public class Ourxa {
    public File getUsTisho() {
        ...
    }
}

public class Phatac {
    public Thepism getSif() {
        ...
    }

    public File getDresu() {
        ...
    }
}

public class PtoGehi {
    public List<Taimad> getTrisms() {
        ...
    }

    public LauPlessti getOkSwae() {
        ...
    }
}

public class Qercluss {
    public Ceek getDaTodiu() {
        ...
    }

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

public class Rewran extends Feni {
    public List<Odeuct> getOusos() {
        ...
    }
}

public class Rioul {
    public byte[] getAnant() {
        ...
    }
}

public class Taimad {
    public List<String> getEpta() {
        ...
    }

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

public class Thanar {
    public List<String> getBrift() {
        ...
    }
}

public class Thepism extends Thanar {
    public List<BreSosprash> getMoins() {
        ...
    }

    public Etviss getDiErrhe() {
        ...
    }
}
  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:

    Qercluss i

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the prai of each trism of the first mipol of each kaIor of the first neClis of i.

    Solution

    for (Cengel neClis : i.getDaTodiu().getNeClisesList()) {
        for (Musm mipol : neClis.getRewran().getFeni().getKaIors().get(0).getTeCudan().getMipolsList()) {
            process(mipol.getPhatac().getSif().getDiErrhe().getPtoGehi().getTrisms().get(0).getPrai());
        }
    }

Related puzzles: