|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthourparser.Person
public class Person
Represents a person who has a personal log file.
Field Summary | |
---|---|
private File |
file
Personal log file of this person. |
private String |
name
Name of this person, or null if no name is known. |
private Vector<Entry> |
records
Work records of this person. |
Constructor Summary | |
---|---|
Person(File file)
Constructs a new person by reading the data from a log file. |
Method Summary | |
---|---|
String[] |
getCodes(Date start,
Date end)
Returns an array of all different codes used during the specified time period. |
Date |
getEnd()
Returns the time of the last record this person has. |
Entry[] |
getEntries(Date start,
Date end)
Returns the entries the person has made during a time period. |
double |
getHours(Date start,
Date end)
Returns how many hours in total the person has made during a time period. |
double |
getHours(Date start,
Date end,
String code)
Returns how many hours of a specific work the person has made during a time period. |
String |
getName()
Returns the name of this person as defined in the first row of the log file. |
Date |
getStart()
Returns the time of the first record this person has. |
private void |
readFile()
Reads all the information from the the log file of this person. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private File file
private String name
null
if no name is known.
private Vector<Entry> records
Constructor Detail |
---|
public Person(File file) throws IOException
file
- the log file of the person.
IOException
- if reading the log file fails.Method Detail |
---|
private void readFile() throws IOException
IOException
- if reading the log file fails.public String getName()
null
if no name is set.public Entry[] getEntries(Date start, Date end)
start
- the beginning of the time period. Results are >= start
.end
- the end of the time period. Results are < end
.
public double getHours(Date start, Date end)
start
- the beginning of the time period. Results are >= start
.end
- the end of the time period. Results are < end
.
public double getHours(Date start, Date end, String code)
start
- the beginning of the time period. Results are >= start
.end
- the end of the time period. Results are < end
.code
- the code of the work type to be included or null
to include all.
public String[] getCodes(Date start, Date end)
start
- the beginning of the time period. Results are >= start
.end
- the end of the time period. Results are < end
.
public Date getStart()
public Date getEnd()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |