1 3 4 package org.jgroups; 5 6 import java.io.IOException ; 7 import java.io.ObjectInput ; 8 import java.io.ObjectOutput ; 9 import java.util.Vector ; 10 11 12 15 public class MergeView extends View { 16 protected Vector subgroups=null; 18 19 22 public MergeView() { 23 } 24 25 26 33 public MergeView(ViewId vid, Vector members, Vector subgroups) { 34 super(vid, members); 35 this.subgroups=subgroups; 36 } 37 38 39 47 public MergeView(Address creator, long id, Vector members, Vector subgroups) { 48 super(creator, id, members); 49 this.subgroups=subgroups; 50 } 51 52 53 public Vector getSubgroups() { 54 return subgroups; 55 } 56 57 58 63 public Object clone() { 64 ViewId vid2=vid != null ? (ViewId)vid.clone() : null; 65 Vector members2=members != null ? (Vector )members.clone() : null; 66 Vector subgroups2=subgroups != null ? (Vector )subgroups.clone() : null; 67 return new MergeView(vid2, members2, subgroups2); 68 } 69 70 71 public String toString() { 72 StringBuffer sb=new StringBuffer (); 73 sb.append("MergeView::" + super.toString()); 74 sb.append(", subgroups=" + subgroups); 75 return sb.toString(); 76 } 77 78 79 public void writeExternal(ObjectOutput out) throws IOException { 80 super.writeExternal(out); 81 out.writeObject(subgroups); 82 } 83 84 85 public void readExternal(ObjectInput in) throws IOException , ClassNotFoundException { 86 super.readExternal(in); 87 subgroups=(Vector )in.readObject(); 88 } 89 90 91 } 92 | Popular Tags |