1 20 package org.objectweb.modfact.jmi.xmiio.mofobject; 21 22 import java.util.List ; 23 import java.util.ArrayList ; 24 import java.util.Iterator ; 25 26 31 public class MOFObjectList { 32 33 34 private List objectList; 35 36 37 private List xmiIdRefList; 38 39 42 public MOFObjectList() { 43 objectList = new ArrayList (); 44 xmiIdRefList = new ArrayList (); 45 } 46 47 51 public void addObject(Object obj) { 52 objectList.add(obj); 53 } 54 55 59 public Iterator getObjects() { 60 return objectList.iterator(); 61 } 62 63 67 public void addXmiIdRef(String xmiid) { 68 xmiIdRefList.add(xmiid); 69 } 70 71 75 public Iterator getXmiIdRef() { 76 return xmiIdRefList.iterator(); 77 } 78 79 83 public void addMOFObjectList(MOFObjectList list) { 84 objectList.addAll(list.objectList); 85 xmiIdRefList.addAll(list.xmiIdRefList); 86 } 87 88 92 public MOFObject getFirstObject() { 93 if (objectList.size() > 0) 94 return new BuiltObject(objectList.get(0)); 95 if (xmiIdRefList.size() > 0) 96 return new XMIIdRef((String ) xmiIdRefList.get(0)); 97 return new NullObject(); 98 } 99 100 } 101 | Popular Tags |