KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > prevayler > demos > demo2 > business > AccountEntry


1 package org.prevayler.demos.demo2.business;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.Date JavaDoc;
5
6 public class AccountEntry implements Serializable JavaDoc {
7
8         private long amount;
9         private Date JavaDoc timestamp;
10
11         private AccountEntry() {
12         }
13         
14         AccountEntry(long amount, Date JavaDoc timestamp) {
15             this.amount = amount;
16             this.timestamp = timestamp;
17         }
18
19         public String JavaDoc toString() {
20             return timestampString() + " Amount: " + amount;
21         }
22
23         private String JavaDoc timestampString() {
24             return new java.text.SimpleDateFormat JavaDoc("yyyy/MM/dd hh:mm:ss.SSS").format(timestamp);
25         }
26 }
27
Popular Tags