1 7 8 package java.beans.beancontext; 9 10 import java.util.EventObject ; 11 12 import java.beans.beancontext.BeanContext ; 13 import java.beans.beancontext.BeanContextEvent ; 14 15 import java.util.Arrays ; 16 import java.util.Collection ; 17 import java.util.Iterator ; 18 19 40 public class BeanContextMembershipEvent extends BeanContextEvent { 41 42 49 50 public BeanContextMembershipEvent(BeanContext bc, Collection changes) { 51 super(bc); 52 53 if (changes == null) throw new NullPointerException ( 54 "BeanContextMembershipEvent constructor: changes is null."); 55 56 children = changes; 57 } 58 59 67 68 public BeanContextMembershipEvent(BeanContext bc, Object [] changes) { 69 super(bc); 70 71 if (changes == null) throw new NullPointerException ( 72 "BeanContextMembershipEvent: changes is null."); 73 74 children = Arrays.asList(changes); 75 } 76 77 81 public int size() { return children.size(); } 82 83 88 public boolean contains(Object child) { 89 return children.contains(child); 90 } 91 92 96 public Object [] toArray() { return children.toArray(); } 97 98 102 public Iterator iterator() { return children.iterator(); } 103 104 107 108 112 protected Collection children; 113 } 114 115 116 117 118 119 | Popular Tags |