corbaitem.java

来自「Icarnegie university SSD8电子书和全部练习答案」· Java 代码 · 共 123 行

JAVA
123
字号
www.pudn.com > Exercise5.rar > CorbaItem.java


import java.util.*; 

/** 
* The item that record the user name, date, id and label. 
* 
* @author Jinjiang 
* 
*/ 
public class CorbaItem { 

private String username; 

private int id; 

private Date start; 

private Date end; 

private String label; 

/** 
* The default constructor. 
* 
*/ 
public CorbaItem() { 
} 

/** 
* The constructor that has all attributes initial. 
* 
* @param u 
* username 
* @param i 
* id 
* @param s 
* start 
* @param e 
* end 
* @param l 
* label 
*/ 
public CorbaItem(String u, int i, Date s, Date e, String l) { 

username = u; 
id = i; 
start = s; 
end = e; 
label = l; 
} 

/** 
* Return the username. 
* 
* @return username 
*/ 
public String getUsername() { 

return username; 
} 

/** 
* Return the id. 
* 
* @return id 
*/ 
public int getId() { 

return id; 
} 

/** 
* Return the start time. 
* 
* @return start time 
*/ 
public Date getStart() { 

return start; 
} 

/** 
* Return the end time. 
* 
* @return end time 
*/ 
public Date getEnd() { 

return end; 
} 

/** 
* Return the lable. 
* 
* @return label 
*/ 
public String getLabel() { 

return label; 
} 

/** 
* Return the description of the item. 
* 
* @return a string to description of the item. 
*/ 
public String toString() { 

return "\nNo." + id + ": " + label + "\n\tStart: " + start.toString() 
+ "\n\tEnd: " + end.toString(); 
} 
} 








⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?