Class relationships: Correct Solution


Consider the follow class declarations:

public class Chlior {
    public int getMiMec() {
        ...
    }

    public Flulmick getTholl() {
        ...
    }

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

public class Cleshaps extends Lobce {
    public File getHaVo() {
        ...
    }
}

public class Eonal {
    public List<NasStemdill> getGoDes() {
        ...
    }

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

public class Flulmick {
    public String getEch() {
        ...
    }
}

public class Harphec {
    public Cleshaps getCou() {
        ...
    }

    public UwlPunim getSiAsqi() {
        ...
    }
}

public class Lobce {
    public File getOsphi() {
        ...
    }
}

public class Mevol {
    public List<Triar> getEsms() {
        ...
    }

    public Chlior getPaOss() {
        ...
    }

    public List<Strasm> getCeds() {
        ...
    }
}

public class Minpes {
    public String getPhol() {
        ...
    }

    public Eonal getSlici() {
        ...
    }
}

public class Mism extends Minpes {
    public byte[] getRicee() {
        ...
    }
}

public class NasStemdill {
    public byte[] getCePorde() {
        ...
    }

    public List<Soadsa> getGaas() {
        ...
    }
}

public class Reor extends Mevol {
    public List<String> getSqisi() {
        ...
    }
}

public class Saisact {
    public String getRess() {
        ...
    }
}

public class Scood {
    public int getFeCiate() {
        ...
    }
}

public class Soadsa extends Harphec {
    public Scood getCic() {
        ...
    }
}

public class Strasm {
    public String getSebeh() {
        ...
    }
}

public class Triar {
    public int getChura() {
        ...
    }

    public List<Vecce> getWols() {
        ...
    }
}

public class UwlPunim {
    public int getIrest() {
        ...
    }

    public List<Reor> getRises() {
        ...
    }
}

public class Vecce extends Saisact {
    public List<String> getUdes() {
        ...
    }
}
  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:

    Mism puto

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the hoGipo of each ris of the first gaa of the first goDe of puto.

    Solution

    for (NasStemdill goDe : puto.getMinpes().getSlici().getGoDesList()) {
        for (Soadsa gaa : goDe.getGaasList()) {
            process(gaa.getHarphec().getSiAsqi().getRises().get(0).getMevol().getPaOss().getHoGipo());
        }
    }

Related puzzles: