hourparser
Class Entry

java.lang.Object
  extended by hourparser.Entry

public class Entry
extends Object

Represents one row in a log file. The format of the log file is like this:

dd.mm.yyyy   code    hours    comment

A row that starts with an alphabet will be used as the name of the person. Rows beginning with # will be concidered empty lines.

Author:
Esko Luontola, http://www.orfjackal.net/

Nested Class Summary
private static class Entry.State
           
 
Field Summary
private  String code
           
private  String comment
           
private  Date date
           
private  double hours
           
private  String name
           
private  Entry.State state
           
 
Constructor Summary
Entry(String row)
          Parses a row from a log file.
 
Method Summary
 String getCode()
           
 String getComment()
           
 Date getDate()
           
 double getHours()
           
 String getName()
           
 boolean isEmpty()
          Is this entry an empty line or a comment.
 boolean isName()
          Is this entry the name of the person.
 boolean isRecord()
          Is this entry a record of work.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

state

private Entry.State state

name

private String name

date

private Date date

code

private String code

hours

private double hours

comment

private String comment
Constructor Detail

Entry

public Entry(String row)
Parses a row from a log file.

Parameters:
row - one row from a log file.
Method Detail

isEmpty

public boolean isEmpty()
Is this entry an empty line or a comment.

Returns:
true if is empty or a comment, otherwise false.

isName

public boolean isName()
Is this entry the name of the person.

Returns:
true if is a name, otherwise false.

isRecord

public boolean isRecord()
Is this entry a record of work.

Returns:
true if is a record, otherwise false.

getName

public String getName()

getDate

public Date getDate()

getCode

public String getCode()

getHours

public double getHours()

getComment

public String getComment()

toString

public String toString()
Overrides:
toString in class Object