Class relationships: Correct Solution


Consider the follow class declarations:

public class Adris {
    public Fiash getIoul() {
        ...
    }

    public List<Stipra> getTodus() {
        ...
    }
}

public class ChuPlech {
    public List<String> getSeZii() {
        ...
    }
}

public class Cotosh {
    public int getTwed() {
        ...
    }
}

public class Cresh extends OrkHai {
    public byte[] getHiru() {
        ...
    }
}

public class Fiash extends Cresh {
    public Kacze getPoena() {
        ...
    }

    public List<ChuPlech> getLeusses() {
        ...
    }
}

public class Herste extends RhiSpistbiod {
    public int getFeact() {
        ...
    }
}

public class IarCiu {
    public File getEeDoi() {
        ...
    }
}

public class Kacze {
    public File getCebi() {
        ...
    }
}

public class Lifous extends WaaIas {
    public File getNel() {
        ...
    }
}

public class OrkHai {
    public Spid getStoo() {
        ...
    }

    public File getShic() {
        ...
    }
}

public class Pralmen {
    public List<TocTrei> getDiCus() {
        ...
    }

    public List<Ruri> getSuths() {
        ...
    }
}

public class RhiSpistbiod extends IarCiu {
    public String getIss() {
        ...
    }

    public int getLel() {
        ...
    }
}

public class Ruri {
    public List<Cotosh> getEsBleis() {
        ...
    }

    public Zasha getMaGep() {
        ...
    }
}

public class Spid {
    public List<String> getUsm() {
        ...
    }

    public List<Urul> getSlers() {
        ...
    }
}

public class Stipra {
    public byte[] getIshi() {
        ...
    }
}

public class Tisstal {
    public List<Adris> getImals() {
        ...
    }

    public int getChel() {
        ...
    }
}

public class TocTrei {
    public Herste getLener() {
        ...
    }

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

public class Urul extends Pralmen {
    public Lifous getArSi() {
        ...
    }
}

public class WaaIas {
    public int getCic() {
        ...
    }
}

public class Zasha {
    public byte[] getPicar() {
        ...
    }
}
  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:

    Tisstal iam

    ...and the following method:

    public void process(int item)

    ...write code to process the lel of the first diCu of the first sler of each imal of iam.

    Solution

    for (Urul sler : iam.getImals().get(0).getIoul().getCresh().getOrkHai().getStoo().getSlersList()) {
        for (TocTrei diCu : sler.getPralmen().getDiCusList()) {
            process(diCu.getLener().getRhiSpistbiod().getLel());
        }
    }

Related puzzles: