Class relationships: Correct Solution


Consider the follow class declarations:

public class Ciosh {
    public List<Fledbi> getFiNusas() {
        ...
    }

    public String getCigad() {
        ...
    }
}

public class Etin extends Trerec {
    public List<Frantce> getCasms() {
        ...
    }

    public List<Thiassic> getUbeses() {
        ...
    }
}

public class Fledbi extends Idscent {
    public NerTenfus getAedve() {
        ...
    }
}

public class Foshfarm {
    public List<Rhiss> getMaAmceses() {
        ...
    }

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

public class Frantce {
    public Wanfi getKeu() {
        ...
    }

    public int getCed() {
        ...
    }
}

public class HacOcol {
    public int getEtri() {
        ...
    }

    public List<Pnosba> getEstis() {
        ...
    }
}

public class Idscent {
    public Minee getCang() {
        ...
    }

    public File getFapac() {
        ...
    }
}

public class Mictio extends Sopli {
    public byte[] getPuRai() {
        ...
    }

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

public class Minee extends Screde {
    public List<Mictio> getOtasts() {
        ...
    }
}

public class NerTenfus {
    public int getSche() {
        ...
    }
}

public class OisMirlcor {
    public int getIrRawl() {
        ...
    }

    public Foshfarm getBansa() {
        ...
    }
}

public class Orprerch extends HacOcol {
    public File getEnCio() {
        ...
    }
}

public class Pirsul {
    public Etin getPeph() {
        ...
    }

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

public class Pnosba {
    public List<String> getPesse() {
        ...
    }

    public Ciosh getNuOst() {
        ...
    }
}

public class Rhiss extends Orprerch {
    public List<Pirsul> getNaEcs() {
        ...
    }
}

public class Screde {
    public int getOuvod() {
        ...
    }
}

public class Sopli {
    public List<String> getIlGech() {
        ...
    }
}

public class Thiassic {
    public String getRor() {
        ...
    }
}

public class Trerec {
    public String getSceda() {
        ...
    }
}

public class Wanfi {
    public File getHioul() {
        ...
    }
}
  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:

    OisMirlcor si

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the totag of the first otast of each fiNusa of each esti of the first maAmces of si.

    Solution

    for (Rhiss maAmces : si.getBansa().getMaAmcesesList()) {
        for (Mictio otast : maAmces.getOrprerch().getHacOcol().getEstis().get(0).getNuOst().getFiNusas().get(0).getIdscent().getCang().getOtastsList()) {
            process(otast.getTotag());
        }
    }

Related puzzles: