Class relationships: Correct Solution


Consider the follow class declarations:

public class Acsor {
    public List<Braletch> getPatbas() {
        ...
    }

    public Hosskni getNeld() {
        ...
    }
}

public class Alsa {
    public File getRaism() {
        ...
    }

    public List<Moiad> getCaScres() {
        ...
    }
}

public class Banses {
    public File getAlic() {
        ...
    }
}

public class Braletch {
    public File getBle() {
        ...
    }

    public List<Moestmi> getNanhus() {
        ...
    }
}

public class Crora extends Oltvunt {
    public List<JesBeftqi> getEcmeds() {
        ...
    }
}

public class Decdiss {
    public String getIlBroe() {
        ...
    }
}

public class Eghter {
    public int getLigi() {
        ...
    }

    public Crora getGrur() {
        ...
    }
}

public class Hosskni extends Thinfi {
    public byte[] getEccu() {
        ...
    }
}

public class JesBeftqi extends Pral {
    public byte[] getMoHism() {
        ...
    }
}

public class Moestmi {
    public String getTrorn() {
        ...
    }

    public List<Decdiss> getScirs() {
        ...
    }
}

public class Moiad {
    public int getHiat() {
        ...
    }
}

public class Oltvunt {
    public int getIosm() {
        ...
    }
}

public class Pral extends Predfur {
    public Splaspra getNissi() {
        ...
    }
}

public class Predfur {
    public List<Zouc> getRurs() {
        ...
    }

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

public class Rildail extends Thelmou {
    public String getFaIs() {
        ...
    }
}

public class Splaspra {
    public String getLicu() {
        ...
    }
}

public class Thelmou {
    public Alsa getOonsu() {
        ...
    }

    public int getSaRulca() {
        ...
    }

    public File getSothe() {
        ...
    }
}

public class Thinfi {
    public File getSeci() {
        ...
    }

    public List<Eghter> getNosacs() {
        ...
    }
}

public class TruPendosm {
    public Banses getUsou() {
        ...
    }

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

public class Zouc extends TruPendosm {
    public Rildail getPeOsbru() {
        ...
    }
}
  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:

    Acsor aar

    ...and the following method:

    public void process(File item)

    ...write code to process the sothe of each rur of the first ecmed of the first nosac of aar.

    Solution

    for (Eghter nosac : aar.getNeld().getThinfi().getNosacsList()) {
        for (JesBeftqi ecmed : nosac.getGrur().getEcmedsList()) {
            process(ecmed.getPral().getPredfur().getRurs().get(0).getPeOsbru().getThelmou().getSothe());
        }
    }

Related puzzles: