1 2 package org.objectweb.proactive.examples.chat; 3 4 import java.io.Serializable ; 5 6 11 public class Message implements Serializable { 12 13 14 private String s; 15 16 20 public Message(String source) { 21 s = source; 22 if (!(s.endsWith("\n"))) 23 s += "\n"; 24 } 25 26 31 public Message(String author, String source) { 32 s = "<" + (new java.util.Date (System.currentTimeMillis())).toString() + "> <" + author + "> " + source; 33 if (!(s.endsWith("\n"))) 34 s += "\n"; 35 } 36 37 40 public String toString() { 41 return s; 42 } 43 } 44 | Popular Tags |