Changes

Jump to: navigation, search

Teams Winter 2011/team6/lab2

885 bytes removed, 13:41, 12 April 2011
Create Java Classes Required
::
{{<nowiki>
 
import java.util.Calendar;
import java.util.Date;
import cs.dps914.osgi.lab.chatinterface.IMessage;
 
 
public class SimpleMessage implements IMessage {
 
 
private String source;
private Date time;
private String message;
public SimpleMessage(String src,String msg) {
setSource(src);
setTime(Calendar.getInstance().getTime());
setMessage(msg);
}
public void setSource(String src) {
if (src!=null) {
source=src;
} else {
source="";
}
}
 
 
public String getSource() {
return source;
}
public void setTime(Date time) {
if (time!=null) {
this.time=time;
} else {
this.time=Calendar.getInstance().getTime();
}
}
 
 
public Date getTime() {
return time;
}
 
 
public void setMessage(String msg) {
if (msg!=null) {
message=msg;
} else {
message="";
}
}
 
 
public String getMessage() {
return message;
}
}
</nowiki>
}}
1
edit

Navigation menu