📄 meeting.java
字号:
/**
*
*/
package agenda.model;
import java.util.*;
/**
* entity class for meeting
*
* @author Cyberpet
*
*/
public class Meeting {
private Date start = new Date();
private Date end = new Date();
private String user = new String("default");
private String other = new String("default-other");
private String title = new String("default-title");
/*
* default constructor
*/
public Meeting() {
}
/*
* constructor with parameters
*/
public Meeting(String user, String other, String title, Date start, Date end)
throws InfoException {
if (user.compareTo(other) == 0 || start.after(end)) {
throw new InfoException(
"User duplicated or date overlapped while creating meeting object\n");
} else {
this.setUser(user);
this.setOther(other);
this.setTitle(title);
this.setStart(start);
this.setEnd(end);
}
}
/**
* @param args
* @return void
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
/*
* setter for start time
*/
public void setStart(Date start) {
if (start != null)
this.start = start;
}
/*
* getter for start time
*/
public Date getStart() {
return start;
}
/*
* setter for end of time
*/
public void setEnd(Date end) {
if (end != null)
this.end = end;
}
/*
* getter for the end of time of meeting
*/
public Date getEnd() {
return end;
}
/*
* setter for user
*/
public void setUser(String user) {
if (!user.isEmpty())
this.user = user;
}
/*
* getter for user
*/
public String getUser() {
return user;
}
public void setOther(String other) {
if (!other.isEmpty())
this.other = other;
}
public String getOther() {
return other;
}
public void setTitle(String title) {
if (!title.isEmpty())
this.title = title;
}
public String getTitle() {
return title;
}
public String toString() {
return String.format("%1$s: %2$s-%3$s %4$s~%5$s\n", this.title,
this.user, this.other, this.start, this.end);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -