Class relationships: Correct Solution


Consider the follow class declarations:

public class Bleloc {
    public String getHar() {
        ...
    }

    public Perden getEstil() {
        ...
    }
}

public class Blorpun {
    public List<String> getPiPilgi() {
        ...
    }
}

public class Bostmad {
    public Buscal getArAu() {
        ...
    }

    public List<Eing> getIrSlis() {
        ...
    }
}

public class Bral {
    public File getNes() {
        ...
    }
}

public class Buscal extends Swongclech {
    public String getUsri() {
        ...
    }
}

public class Ceph extends Hicslert {
    public List<Sami> getIsas() {
        ...
    }
}

public class Eing {
    public String getNedan() {
        ...
    }
}

public class Eion {
    public byte[] getNamun() {
        ...
    }

    public File getCioa() {
        ...
    }
}

public class Greng {
    public IacPulchu getAsass() {
        ...
    }

    public Bleloc getWeSucpa() {
        ...
    }
}

public class Hicslert {
    public Bral getFiIcmos() {
        ...
    }

    public List<Greng> getGlas() {
        ...
    }
}

public class IacPulchu {
    public byte[] getClol() {
        ...
    }
}

public class Maphon {
    public int getReIread() {
        ...
    }
}

public class OssGlackneul {
    public File getTru() {
        ...
    }
}

public class Perden extends SweUba {
    public List<Phenres> getMasms() {
        ...
    }
}

public class Phenres extends Scro {
    public List<Pnagiss> getTwogos() {
        ...
    }
}

public class Pnagiss {
    public List<String> getBiiss() {
        ...
    }
}

public class Proosscho extends Tibol {
    public File getVir() {
        ...
    }
}

public class Sami {
    public List<String> getTuus() {
        ...
    }
}

public class Scro {
    public String getKiOc() {
        ...
    }
}

public class Sodioct {
    public Proosscho getHos() {
        ...
    }

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

public class Stengsposs extends OssGlackneul {
    public File getDocna() {
        ...
    }
}

public class SweUba {
    public String getRuOin() {
        ...
    }

    public List<Sodioct> getOsles() {
        ...
    }
}

public class Swongclech extends Blorpun {
    public List<Ceph> getOrSors() {
        ...
    }
}

public class Tibol {
    public List<Eion> getDeFeks() {
        ...
    }

    public Stengsposs getPsed() {
        ...
    }

    public Maphon getTeIs() {
        ...
    }
}
  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:

    Bostmad spe

    ...and the following method:

    public void process(File item)

    ...write code to process the cioa of each deFek of the first osle of the first gla of the first orSor of spe.

    Solution

    for (Ceph orSor : spe.getArAu().getSwongclech().getOrSorsList()) {
        for (Greng gla : orSor.getHicslert().getGlasList()) {
            for (Sodioct osle : gla.getWeSucpa().getEstil().getSweUba().getOslesList()) {
                process(osle.getHos().getTibol().getDeFeks().get(0).getCioa());
            }
        }
    }

Related puzzles: