Class relationships: Correct Solution


Consider the follow class declarations:

public class Acuc {
    public byte[] getAifoc() {
        ...
    }
}

public class Bahi {
    public List<Fligang> getSuCredis() {
        ...
    }

    public List<Cossdol> getRions() {
        ...
    }

    public List<Chiudod> getGrivos() {
        ...
    }

    public WilCin getReni() {
        ...
    }
}

public class Besphu {
    public List<String> getEdPid() {
        ...
    }
}

public class Camest {
    public File getCrar() {
        ...
    }
}

public class Chiudod {
    public List<String> getSacar() {
        ...
    }
}

public class CioTromros extends Sanbrud {
    public List<Besphu> getOmesms() {
        ...
    }
}

public class Cossdol {
    public int getMarpe() {
        ...
    }

    public Acuc getTasib() {
        ...
    }

    public File getAun() {
        ...
    }
}

public class Fasi {
    public List<String> getIctan() {
        ...
    }
}

public class Fligang {
    public String getEmeen() {
        ...
    }
}

public class Fock {
    public List<String> getCrec() {
        ...
    }
}

public class Garba {
    public Fock getScint() {
        ...
    }

    public Kuche getPra() {
        ...
    }
}

public class Gerhu {
    public File getHumos() {
        ...
    }
}

public class HoaSelec {
    public byte[] getShrin() {
        ...
    }
}

public class Ilsar {
    public Zesplas getRaTir() {
        ...
    }

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

public class Knimgae extends Ilsar {
    public Fasi getOsvuc() {
        ...
    }
}

public class Kuche extends Thongslan {
    public File getAshac() {
        ...
    }
}

public class Ooss {
    public List<CioTromros> getSiIses() {
        ...
    }

    public int getAcMa() {
        ...
    }
}

public class Sanbrud extends Bahi {
    public byte[] getHax() {
        ...
    }
}

public class Slarncos {
    public List<Knimgae> getOpenns() {
        ...
    }

    public HoaSelec getUal() {
        ...
    }
}

public class Thongslan {
    public int getWou() {
        ...
    }

    public List<Slarncos> getOsts() {
        ...
    }
}

public class WilCin extends Camest {
    public int getVeRowl() {
        ...
    }
}

public class Zesplas {
    public Ooss getPende() {
        ...
    }

    public List<Gerhu> getDilas() {
        ...
    }
}
  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:

    Garba vir

    ...and the following method:

    public void process(File item)

    ...write code to process the aun of each rion of the first siIs of each openn of each ost of vir.

    Solution

    for (CioTromros siIs : vir.getPra().getThongslan().getOsts().get(0).getOpenns().get(0).getIlsar().getRaTir().getPende().getSiIsesList()) {
        process(siIs.getSanbrud().getBahi().getRions().get(0).getAun());
    }

Related puzzles: