Class relationships: Correct Solution


Consider the follow class declarations:

public class AarTir {
    public File getHudil() {
        ...
    }
}

public class BiaUdra {
    public String getGiMinac() {
        ...
    }
}

public class Cerhi extends DusMesaff {
    public List<Spenrherm> getSaIls() {
        ...
    }
}

public class Choo {
    public Ogal getPoChipo() {
        ...
    }

    public int getNuc() {
        ...
    }
}

public class Dilgil extends Petrit {
    public List<Hirph> getBehis() {
        ...
    }

    public Prirpre getFomal() {
        ...
    }
}

public class DusMesaff {
    public List<Mengi> getOtScrais() {
        ...
    }

    public Dilgil getEhac() {
        ...
    }

    public BiaUdra getEnGeng() {
        ...
    }
}

public class Hirph extends AarTir {
    public int getPaDi() {
        ...
    }
}

public class Mengi {
    public int getSoec() {
        ...
    }
}

public class Ogal {
    public List<Cerhi> getNems() {
        ...
    }

    public int getBeved() {
        ...
    }
}

public class Petrit extends WorProrjae {
    public Thia getCiLilir() {
        ...
    }
}

public class Poungsplic {
    public byte[] getTirru() {
        ...
    }

    public List<Upelm> getStedes() {
        ...
    }
}

public class Prirpre {
    public List<String> getUdpin() {
        ...
    }
}

public class Sedman {
    public File getCeAen() {
        ...
    }
}

public class Spenrherm extends SpoCerdci {
    public byte[] getEnt() {
        ...
    }
}

public class SpoCerdci {
    public List<String> getEpom() {
        ...
    }
}

public class Susun {
    public List<Trelcis> getVecs() {
        ...
    }

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

public class Thia {
    public List<Susun> getCeecus() {
        ...
    }

    public Sedman getOsban() {
        ...
    }
}

public class Trelcis {
    public int getEmpo() {
        ...
    }

    public int getVanur() {
        ...
    }
}

public class Upelm extends Choo {
    public File getVeLos() {
        ...
    }
}

public class WorProrjae {
    public String getOsm() {
        ...
    }
}
  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:

    Poungsplic fa

    ...and the following method:

    public void process(int item)

    ...write code to process the vanur of the first vec of the first ceecu of each nem of each stede of fa.

    Solution

    for (Susun ceecu : fa.getStedes().get(0).getChoo().getPoChipo().getNems().get(0).getDusMesaff().getEhac().getPetrit().getCiLilir().getCeecusList()) {
        for (Trelcis vec : ceecu.getVecsList()) {
            process(vec.getVanur());
        }
    }

Related puzzles: