Class relationships: Correct Solution


Consider the follow class declarations:

public class Artdem extends Scon {
    public String getSimo() {
        ...
    }
}

public class Hass {
    public byte[] getHeCe() {
        ...
    }
}

public class Hoswi {
    public MulThismmioc getNang() {
        ...
    }

    public Thil getSeced() {
        ...
    }

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

public class Massung {
    public String getFoum() {
        ...
    }
}

public class Mousto extends Spism {
    public byte[] getCecae() {
        ...
    }
}

public class MulThismmioc {
    public String getSple() {
        ...
    }
}

public class Parhel {
    public List<Tiasid> getRaos() {
        ...
    }

    public String getAsend() {
        ...
    }
}

public class Psidil extends Siip {
    public File getRuZass() {
        ...
    }
}

public class Raurdor {
    public Mousto getIsScro() {
        ...
    }

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

public class Scon extends Hass {
    public int getBre() {
        ...
    }
}

public class Siip {
    public Massung getPoDiost() {
        ...
    }

    public Parhel getNoAtec() {
        ...
    }
}

public class Spism {
    public List<Hoswi> getEsMis() {
        ...
    }

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

public class Striashar {
    public List<String> getSanu() {
        ...
    }
}

public class Thil {
    public byte[] getFaKhes() {
        ...
    }

    public List<Striashar> getHios() {
        ...
    }
}

public class Tiasid extends Vambring {
    public List<Artdem> getVacgos() {
        ...
    }
}

public class Vambring {
    public int getIkAivud() {
        ...
    }

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

    Psidil mo

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the decis of the first esMi of the first eped of each rao of mo.

    Solution

    for (Raurdor eped : mo.getSiip().getNoAtec().getRaos().get(0).getVambring().getEpedsList()) {
        for (Hoswi esMi : eped.getIsScro().getSpism().getEsMisList()) {
            process(esMi.getDecis());
        }
    }

Related puzzles: