1 25 26 package org.objectweb.speedo.pobjects.detach.groupama; 27 28 import java.util.ArrayList ; 29 import java.util.Collection ; 30 import java.util.Iterator ; 31 32 35 public class A { 36 37 private int idA; 38 private Collection bs; 39 40 public A(int idA) { 41 this.idA = idA; 42 bs = new ArrayList (); 43 } 44 45 46 public Collection getBs() { 47 return bs; 48 } 49 public void setBs(Collection bs) { 50 this.bs = bs; 51 } 52 public void addB(B b){ 53 bs.add(b); 54 b.setA(this); 55 } 56 57 public int getIdA() { 58 return idA; 59 } 60 public void setIdA(int idA) { 61 this.idA = idA; 62 } 63 64 public String toString(){ 65 String s = "A[idA=" + idA; 66 if(bs != null){ 67 s += ",bs="; 68 Iterator it = bs.iterator(); 69 while(it.hasNext()){ 70 B b = (B) it.next(); 71 s += b.toString() + ","; 72 } 73 } 74 return s; 75 } 76 } 77 | Popular Tags |