Class relationships: Correct Solution


Consider the follow class declarations:

public class Ackspa {
    public List<Prinar> getMaPiwks() {
        ...
    }

    public Mard getPri() {
        ...
    }
}

public class Ciasmang {
    public byte[] getUrAneph() {
        ...
    }
}

public class Diostfi {
    public List<Tepen> getBaShairs() {
        ...
    }

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

public class Duam {
    public Sispru getJou() {
        ...
    }

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

public class Festen {
    public File getSela() {
        ...
    }

    public Sialwha getTeKnoc() {
        ...
    }
}

public class Fisseck extends Nust {
    public File getFodtu() {
        ...
    }
}

public class Mard extends Noshsior {
    public byte[] getBosm() {
        ...
    }
}

public class Mastior {
    public String getOum() {
        ...
    }

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

public class Noshsior {
    public List<Ciasmang> getTaDes() {
        ...
    }

    public int getAuIoel() {
        ...
    }
}

public class Nust {
    public String getOss() {
        ...
    }
}

public class Ourtis extends Diostfi {
    public List<Tasm> getEecers() {
        ...
    }
}

public class Peffpa {
    public Toker getVeNispa() {
        ...
    }

    public String getEnt() {
        ...
    }
}

public class Phastma {
    public int getAtse() {
        ...
    }

    public Wudpess getCoso() {
        ...
    }
}

public class Prinar {
    public Shismo getPou() {
        ...
    }

    public Mastior getFle() {
        ...
    }
}

public class Rillsil extends Ackspa {
    public List<Stacuiss> getOfics() {
        ...
    }
}

public class Shismo {
    public File getDaad() {
        ...
    }
}

public class Sialwha {
    public List<Peffpa> getUiBes() {
        ...
    }

    public List<Rillsil> getBaurs() {
        ...
    }

    public Fisseck getBadte() {
        ...
    }
}

public class Sispru extends Festen {
    public int getPiCe() {
        ...
    }
}

public class Stacuiss {
    public int getVess() {
        ...
    }
}

public class Tasm {
    public int getMiIebas() {
        ...
    }
}

public class Tepen extends Duam {
    public List<String> getDilmi() {
        ...
    }
}

public class Toker {
    public int getNuu() {
        ...
    }
}

public class Ustsunt {
    public byte[] getSeuim() {
        ...
    }
}

public class Wudpess extends Ustsunt {
    public List<Ourtis> getOsnases() {
        ...
    }
}
  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:

    Phastma me

    ...and the following method:

    public void process(byte[] item)

    ...write code to process the todo of the first maPiwk of each baur of each baShair of each osnas of me.

    Solution

    for (Prinar maPiwk : me.getCoso().getOsnases().get(0).getDiostfi().getBaShairs().get(0).getDuam().getJou().getFesten().getTeKnoc().getBaurs().get(0).getAckspa().getMaPiwksList()) {
        process(maPiwk.getFle().getTodo());
    }

Related puzzles: