1 package org.neuclear.ledger;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import java.io.Serializable;
24 import java.util.Date;
25
26 /***
27 * User: pelleb
28 * Date: Apr 19, 2004
29 * Time: 10:51:01 AM
30 */
31 public class Ledger implements Serializable {
32 protected Ledger() {
33 }
34
35 public Ledger(String id, String nickname, String type, String source, Date registered, Date updated, String registrationid, String unit, int decimal) {
36 this.id = id;
37 this.nickname = nickname;
38 this.type = type;
39 this.source = source;
40 this.registered = registered;
41 this.updated = updated;
42 this.registrationid = registrationid;
43 this.unit = unit;
44 this.decimal = decimal;
45 }
46
47 public Ledger(String id, Date registered) {
48 this.id = id;
49 System.out.println("ID=" + id);
50 this.nickname = (id.length() == 32) ? (
51 id.substring(0, 4) + '-'
52 + id.substring(4, 8)
53 ) : id;
54 this.type = "asset";
55 this.source = null;
56 this.registered = registered;
57 this.updated = registered;
58 this.registrationid = null;
59 this.decimal = 2;
60 this.unit = "";
61 }
62
63 public String getId() {
64 return id;
65 }
66
67 public String getNickname() {
68 return nickname;
69 }
70
71 public String getType() {
72 return type;
73 }
74
75 public String getSource() {
76 return source;
77 }
78
79 public Date getRegistered() {
80 return registered;
81 }
82
83 public Date getUpdated() {
84 return updated;
85 }
86
87 public String getRegistrationId() {
88 return registrationid;
89 }
90
91 public String getUnit() {
92 return unit;
93 }
94
95 public int getDecimalPoint() {
96 return decimal;
97 }
98
99 protected String id;
100 protected String nickname;
101 protected String type;
102 protected String source;
103 protected Date registered;
104 protected Date updated;
105 protected String registrationid;
106 protected String unit;
107 protected int decimal;
108 }