Class relationships: Correct Solution


Consider the follow class declarations:

public class BlaAios {
    public List<Tooon> getOrons() {
        ...
    }

    public EesUssang getGicga() {
        ...
    }

    public Sardron getImor() {
        ...
    }
}

public class Brada {
    public File getEou() {
        ...
    }
}

public class Cang extends Isess {
    public int getBetut() {
        ...
    }
}

public class EesUssang {
    public File getFrias() {
        ...
    }

    public List<IarRir> getHihans() {
        ...
    }
}

public class Henrast {
    public String getLus() {
        ...
    }
}

public class IarRir {
    public int getUsIrgio() {
        ...
    }

    public File getSaod() {
        ...
    }
}

public class Insto {
    public int getUced() {
        ...
    }
}

public class Isess {
    public List<String> getPloc() {
        ...
    }

    public Linscrec getAiShixo() {
        ...
    }
}

public class Knen {
    public byte[] getEnDoid() {
        ...
    }
}

public class Lacgleght {
    public int getOocid() {
        ...
    }
}

public class Lilpat {
    public List<String> getLoStas() {
        ...
    }

    public List<Ticha> getTios() {
        ...
    }
}

public class Linscrec extends Insto {
    public Strilste getBinpe() {
        ...
    }

    public Knen getRil() {
        ...
    }
}

public class Mecfrirt {
    public int getOcAl() {
        ...
    }
}

public class Moushspan extends Mecfrirt {
    public byte[] getMaFrio() {
        ...
    }
}

public class Nixfront extends Pruc {
    public List<Cang> getLeDas() {
        ...
    }
}

public class Pruc {
    public List<String> getDra() {
        ...
    }

    public List<Henrast> getTros() {
        ...
    }
}

public class Sardron {
    public int getUwir() {
        ...
    }
}

public class Scepe extends Lacgleght {
    public Brada getOuk() {
        ...
    }

    public Twec getPipad() {
        ...
    }
}

public class Snespian {
    public File getStess() {
        ...
    }

    public List<Scepe> getStaes() {
        ...
    }
}

public class Strilste extends Snespian {
    public List<Moushspan> getPronds() {
        ...
    }
}

public class Theresm {
    public File getPisop() {
        ...
    }
}

public class Ticha extends BlaAios {
    public List<Theresm> getErIvids() {
        ...
    }
}

public class Tooon {
    public int getBipo() {
        ...
    }
}

public class Twec extends Lilpat {
    public byte[] getBru() {
        ...
    }
}
  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:

    Nixfront fre

    ...and the following method:

    public void process(File item)

    ...write code to process the saod of the first hihan of each tio of the first stae of the first leDa of fre.

    Solution

    for (Cang leDa : fre.getLeDasList()) {
        for (Scepe stae : leDa.getIsess().getAiShixo().getBinpe().getSnespian().getStaesList()) {
            for (IarRir hihan : stae.getPipad().getLilpat().getTios().get(0).getBlaAios().getGicga().getHihansList()) {
                process(hihan.getSaod());
            }
        }
    }

Related puzzles: