Class relationships: Correct Solution


Consider the follow class declarations:

public class Biper extends Psearche {
    public File getHeppe() {
        ...
    }

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

public class Broia {
    public String getCida() {
        ...
    }
}

public class Castre {
    public File getOss() {
        ...
    }
}

public class EshAtin {
    public List<Trissqongs> getSoThecs() {
        ...
    }

    public File getMipil() {
        ...
    }
}

public class Ikont {
    public List<Suptec> getMaTulpas() {
        ...
    }

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

public class Lanesm {
    public int getReol() {
        ...
    }
}

public class Mestu {
    public int getCald() {
        ...
    }
}

public class Moictsimb {
    public int getClur() {
        ...
    }
}

public class Plopphio {
    public String getUrut() {
        ...
    }

    public Biper getPuIci() {
        ...
    }
}

public class Pnauli extends Prioctosm {
    public List<String> getAmCaft() {
        ...
    }
}

public class Prioctosm {
    public int getCeci() {
        ...
    }

    public List<Plopphio> getCaCeods() {
        ...
    }
}

public class Prit {
    public Moictsimb getOpoul() {
        ...
    }

    public Wahe getSoas() {
        ...
    }
}

public class Psearche {
    public Mestu getPioun() {
        ...
    }

    public String getAeot() {
        ...
    }
}

public class Saxstau {
    public List<String> getDuIflel() {
        ...
    }

    public Uprind getTiOal() {
        ...
    }
}

public class Suptec extends Prit {
    public EshAtin getEsBi() {
        ...
    }
}

public class Trissqongs {
    public List<Castre> getFiGistos() {
        ...
    }

    public File getEcic() {
        ...
    }
}

public class Uprind extends Pnauli {
    public List<Lanesm> getMioghs() {
        ...
    }
}

public class Wahe extends Broia {
    public List<Saxstau> getRamrus() {
        ...
    }
}
  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:

    Ikont se

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the enon of the first caCeod of the first ramru of each maTulpa of se.

    Solution

    for (Saxstau ramru : se.getMaTulpas().get(0).getPrit().getSoas().getRamrusList()) {
        for (Plopphio caCeod : ramru.getTiOal().getPnauli().getPrioctosm().getCaCeodsList()) {
            process(caCeod.getPuIci().getEnon());
        }
    }

Related puzzles: