Class relationships: Correct Solution


Consider the follow class declarations:

public class Caan extends Stori {
    public File getMeDi() {
        ...
    }
}

public class Cinnfe {
    public List<String> getEcBe() {
        ...
    }
}

public class DacPsochiant {
    public String getWrei() {
        ...
    }
}

public class Delon {
    public Nomposh getSnor() {
        ...
    }

    public File getCeOuth() {
        ...
    }
}

public class Enxril {
    public String getDuTa() {
        ...
    }
}

public class EotPheldpeng {
    public List<Prascunt> getCiltos() {
        ...
    }

    public Cinnfe getIrm() {
        ...
    }

    public List<Plasmoc> getOtEhors() {
        ...
    }
}

public class Gofdes extends IedOolud {
    public List<Hestdroun> getFeses() {
        ...
    }
}

public class Hestdroun {
    public byte[] getFeSnad() {
        ...
    }
}

public class IedOolud {
    public String getMec() {
        ...
    }

    public List<RorOtaism> getQuRengs() {
        ...
    }
}

public class Ihon {
    public File getCin() {
        ...
    }

    public List<Poman> getAsafs() {
        ...
    }
}

public class Jian {
    public List<String> getArd() {
        ...
    }
}

public class Jinsas {
    public List<String> getInbo() {
        ...
    }

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

public class Nomposh {
    public List<String> getCina() {
        ...
    }

    public Gofdes getDidso() {
        ...
    }
}

public class Nuedchre {
    public List<Delon> getAbVahons() {
        ...
    }

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

public class Plasmoc extends Snui {
    public int getNost() {
        ...
    }
}

public class Poman {
    public int getAplan() {
        ...
    }

    public DacPsochiant getBir() {
        ...
    }
}

public class Prascunt {
    public byte[] getLih() {
        ...
    }
}

public class Rhar {
    public File getDul() {
        ...
    }
}

public class Risa extends Jian {
    public List<Setpar> getIsans() {
        ...
    }

    public Rhar getMoAgir() {
        ...
    }
}

public class RorOtaism extends Ihon {
    public EotPheldpeng getGucra() {
        ...
    }
}

public class Setpar {
    public String getInPi() {
        ...
    }
}

public class Snui {
    public List<Enxril> getCaPelras() {
        ...
    }

    public List<Caan> getBidils() {
        ...
    }
}

public class Stori {
    public byte[] getKnosh() {
        ...
    }

    public Jinsas getDasdo() {
        ...
    }
}

public class Weji extends Nuedchre {
    public Risa getHaIs() {
        ...
    }
}
  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:

    Weji aci

    ...and the following method:

    public void process(List<String> item)

    ...write code to process the acUqost of the first bidil of the first otEhor of the first quReng of each abVahon of aci.

    Solution

    for (RorOtaism quReng : aci.getNuedchre().getAbVahons().get(0).getSnor().getDidso().getIedOolud().getQuRengsList()) {
        for (Plasmoc otEhor : quReng.getGucra().getOtEhorsList()) {
            for (Caan bidil : otEhor.getSnui().getBidilsList()) {
                process(bidil.getStori().getDasdo().getAcUqost());
            }
        }
    }

Related puzzles: