📄 timeentryreportdto.java
字号:
package com.wiley.compBooks.EJwithUML.Dtos;
import java.util.*;
import java.io.*;
import com.wiley.compBooks.EJwithUML.Base.DateUtil;
/**
* This class captures time entries by user. The time entries captured will
* be based on some search criteria in the context of a use case.
*/
public class TimeEntryReportDTO implements Serializable
{
private String name;
private ArrayList entries = new ArrayList();
public TimeEntryReportDTO(String name)
{
setName(name);
}
public String getName()
{
return this.name;
}
public void setName(String name)
{
this.name = name;
}
public Iterator getTimeEntries()
{
return this.entries.iterator();
}
public void setTimeEntries(ArrayList entries)
{
this.entries = entries;
}
public void addTimeEntry(TimeEntryDTO entry)
{
this.entries.add(entry);
}
public String toString()
{
StringBuffer buffer = new StringBuffer();
Iterator entryIterator = entries.iterator();
buffer.append("TimeEntryReport[name="+name);
int count = 0;
while(entryIterator.hasNext())
{
count++;
TimeEntryDTO entry = (TimeEntryDTO) entryIterator.next();
buffer.append(",#"+count +"{" + entry.toString()+ "}");
}
buffer.append("]");
return buffer.toString();
}
public int hashCode()
{
return (name.hashCode() ^ entries.hashCode());
}
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
else
{
if (!obj.getClass().equals(this.getClass()))
{
return false;
}
else
{
TimeEntryReportDTO report = (TimeEntryReportDTO)obj;
return ((report.name.equals(this.name)) &&
(report.entries.equals(this.entries)));
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -