1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package net.sf.statcvs.model;
21
22 import java.util.SortedSet;
23 import java.util.TreeSet;
24
25
26
27
28
29
30
31
32
33 public class Author implements Comparable {
34 private final String name;
35 private final SortedSet revisions = new TreeSet();
36 private final SortedSet directories = new TreeSet();
37 private String realName;
38 private String homePageUrl;
39 private String imageUrl;
40 private String email;
41
42
43
44
45
46 public Author(final String name) {
47 this.name = name;
48 this.realName = name;
49 }
50
51
52
53
54
55 protected void addRevision(final Revision revision) {
56 revisions.add(revision);
57 directories.add(revision.getFile().getDirectory());
58 }
59
60
61
62
63
64 public String getName() {
65 return name;
66 }
67
68
69
70
71
72
73 public SortedSet getRevisions() {
74 return revisions;
75 }
76
77
78
79
80
81
82 public SortedSet getDirectories() {
83 return directories;
84 }
85
86
87
88
89
90 public int compareTo(final Object o) {
91 return name.compareTo(((Author) o).getName());
92 }
93
94
95
96
97 public String toString() {
98 return realName + "(" + revisions.size() + " revisions)";
99 }
100
101 public String getHomePageUrl() {
102 return homePageUrl;
103 }
104
105 public void setHomePageUrl(final String homePageUrl) {
106 this.homePageUrl = homePageUrl;
107 }
108
109 public String getImageUrl() {
110 return imageUrl;
111 }
112
113 public void setImageUrl(final String imageUrl) {
114 this.imageUrl = imageUrl;
115 }
116
117 public String getRealName() {
118 return realName;
119 }
120
121 public void setRealName(final String realName) {
122 if (realName != null) {
123 this.realName = realName;
124 }
125 }
126
127 public String getEmail() {
128 return email;
129 }
130
131 public void setEmail(final String email) {
132 this.email = email;
133 }
134 }