コード例 #1
0
ファイル: Object.java プロジェクト: BackupTheBerlios/lem-svn
 /** function to return the class names of all instances in this object */
 public Collection getClassNames() {
   Collection c = new LinkedList();
   Iterator i = instances.iterator();
   while (i.hasNext()) {
     Instance inst = (Instance) i.next();
     c.add(inst.getInstanceClass().getName());
   }
   return c;
 }
コード例 #2
0
ファイル: Object.java プロジェクト: BackupTheBerlios/lem-svn
  /**
   * Finds the first event which matches the given event name and parameter list in this Object.
   * Instances are searched for events in an arbitrary order.
   *
   * @param name the event name
   * @param params the parameter list
   * @todo the search only matches event names, not event name + parameter list
   */
  public org.jdns.xtuml.metamodel.Event findEvent(String name, LinkedList params) {
    Iterator i = instances.iterator();

    while (i.hasNext()) {
      Instance inst = (Instance) i.next();
      org.jdns.xtuml.metamodel.Class c = inst.getInstanceClass();
      org.jdns.xtuml.metamodel.Event e = c.getEvent(name);
      if (e != null) return e;
    }

    return null;
  }