public Vector getChildren(Object parent) { if (!(parent instanceof MClass)) return null; Vector res = new Vector(); Vector ends = new Vector(((MClass)parent).getAssociationEnds()); if (ends == null) return null; java.util.Enumeration enum = ends.elements(); while (enum.hasMoreElements()) { MAssociationEnd ae = (MAssociationEnd) enum.nextElement(); MAssociation asc = ae.getAssociation(); Vector allEnds = new Vector( asc.getConnections()); MAssociationEnd otherEnd = null; if (ae == allEnds.elementAt(0)) otherEnd = (MAssociationEnd) allEnds.elementAt(1); if (ae == allEnds.elementAt(1)) otherEnd = (MAssociationEnd) allEnds.elementAt(0); if (otherEnd == null) continue; if (!otherEnd.isNavigable()) continue; if (res.contains(otherEnd.getType())) continue; res.addElement(otherEnd.getType()); // needs-more-work: handle n-way Associations } return res; }
public Vector getPrereqs() { Vector pros = new Vector(); pros.addElement(MClassifier.class); return pros; }