1 24 package com.scalagent.kjoram.comm; 25 26 import com.scalagent.kjoram.messages.Message; 27 28 import java.util.Vector ; 29 30 34 public class BrowseReply extends AbstractReply 35 { 36 37 private Message message = null; 38 39 private Vector messages = null; 40 41 42 47 public BrowseReply(BrowseRequest req) 48 { 49 super(req.getClientContext(), req.getRequestId()); 50 } 51 52 53 54 public void addMessage(Message msg) 55 { 56 if (message == null && messages == null) 57 message = msg; 58 else { 59 if (messages == null) { 60 messages = new Vector (); 61 messages.addElement(message); 62 message = null; 63 } 64 messages.addElement(msg); 65 } 66 } 67 68 69 public Vector getMessages() 70 { 71 if (message != null) { 72 Vector vec = new Vector (); 73 vec.addElement(message); 74 return vec; 75 } 76 return messages; 77 } 78 } 79 | Popular Tags |