-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpublication.java
More file actions
32 lines (26 loc) · 771 Bytes
/
Copy pathpublication.java
File metadata and controls
32 lines (26 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import java.util.*;
public class Publication {
private static Set ps= new HashSet(650000);
private static int maxNumberOfAuthors = 0;
private String key;
private Person[] authors; // or editors
public Publication(String key, Person[] persons) {
this.key = key;
authors = persons;
ps.add(this);
if (persons.length > maxNumberOfAuthors)
maxNumberOfAuthors = persons.length;
}
public static int getNumberOfPublications() {
return ps.size();
}
public static int getMaxNumberOfAuthors() {
return maxNumberOfAuthors;
}
public Person[] getAuthors() {
return authors;
}
static Iterator iterator() {
return ps.iterator();
}
}