Class relationships: Correct Solution


Consider the follow class declarations:

public class Cenluss extends Pesm {
    public String getDiwce() {
        ...
    }
}

public class Chirvoss {
    public List<Cenluss> getAcdis() {
        ...
    }

    public int getBulus() {
        ...
    }
}

public class Cindo {
    public List<String> getEsma() {
        ...
    }

    public List<Spockcos> getSpeps() {
        ...
    }
}

public class Densess {
    public File getEcpri() {
        ...
    }
}

public class Doduc extends Nafon {
    public List<Fotchram> getWatpos() {
        ...
    }

    public Densess getIss() {
        ...
    }
}

public class Eepec {
    public int getRauss() {
        ...
    }

    public ImeEston getItol() {
        ...
    }
}

public class Fonpid extends Eepec {
    public int getEpSeng() {
        ...
    }
}

public class Fotchram {
    public byte[] getQan() {
        ...
    }
}

public class Gont {
    public int getEsEno() {
        ...
    }

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

public class ImeEston {
    public Prisgis getNio() {
        ...
    }

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

public class Insu {
    public List<Fonpid> getPeEms() {
        ...
    }

    public int getCihon() {
        ...
    }
}

public class Mosta extends Spliod {
    public List<Cindo> getTrises() {
        ...
    }

    public Insu getMeOss() {
        ...
    }
}

public class Nafon {
    public String getJaMuiss() {
        ...
    }

    public Sersca getSarte() {
        ...
    }
}

public class Noct {
    public int getBeled() {
        ...
    }
}

public class Pesm extends Pesmvi {
    public List<Mosta> getStreis() {
        ...
    }
}

public class Pesmvi {
    public String getQora() {
        ...
    }
}

public class Prisgis {
    public List<Triso> getIcHipis() {
        ...
    }

    public int getLoen() {
        ...
    }
}

public class RolOdalk extends Chirvoss {
    public Stiasscir getReEsirm() {
        ...
    }
}

public class Sersca {
    public byte[] getBiIl() {
        ...
    }
}

public class Spliod {
    public int getQosge() {
        ...
    }
}

public class Spockcos {
    public File getRaUsia() {
        ...
    }
}

public class Stiasscir {
    public byte[] getRecin() {
        ...
    }
}

public class Triso extends Gont {
    public Noct getTorno() {
        ...
    }
}

public class Zicu {
    public RolOdalk getPrir() {
        ...
    }

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

    Zicu o

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the nono of each icHipi of the first peEm of the first strei of each acdi of o.

    Solution

    for (Mosta strei : o.getPrir().getChirvoss().getAcdis().get(0).getPesm().getStreisList()) {
        for (Fonpid peEm : strei.getMeOss().getPeEmsList()) {
            process(peEm.getEepec().getItol().getNio().getIcHipis().get(0).getGont().getNono());
        }
    }

Related puzzles: