1 /* 2 * Replica is published under the terms 3 * of the Apache Software License. 4 */ 5 package replica.group.event; 6 7 import java.util.Iterator; 8 import java.util.List; 9 10 import replica.group.Address; 11 12 /*** 13 * Event class for view changed events. 14 * 15 * @author Pedro Costa 16 * @author Helder Silva 17 * @since 19/Jan/2004 18 */ 19 public class ViewEvent extends GroupEvent { 20 21 private List view; 22 23 /*** 24 * @param source 25 */ 26 public ViewEvent(Object source, List view) { 27 super(source); 28 setView( view); 29 } 30 31 /*** 32 * @return 33 */ 34 public List getView() { 35 return view; 36 } 37 38 /*** 39 * @param list 40 */ 41 private void setView(List list) { 42 view = list; 43 } 44 45 public String toString(){ 46 StringBuffer result = new StringBuffer(); 47 result.append("ViewEvent: {"); 48 49 List view = getView(); 50 for (Iterator iter = view.iterator(); iter.hasNext();) { 51 Address element = (Address) iter.next(); 52 result.append("["+element+"] "); 53 } 54 result.append("}."); 55 56 return result.toString(); 57 } 58 59 }

This page was automatically generated by Maven