User: Dallan Date: 12/24/11
| 23 | * Date: 12/24/11 |
| 24 | */ |
| 25 | public class Gedcom extends ExtensionContainer { |
| 26 | private Header head = null; |
| 27 | private List<Submitter> subms = null; |
| 28 | private Submission subn = null; |
| 29 | private List<Person> people = null; |
| 30 | private List<Family> families = null; |
| 31 | private List<Media> media = null; |
| 32 | private List<Note> notes = null; |
| 33 | private List<Source> sources = null; |
| 34 | private List<Repository> repositories = null; |
| 35 | |
| 36 | private transient Map<String, Person> personIndex; |
| 37 | private transient Map<String, Family> familyIndex; |
| 38 | private transient Map<String, Media> mediaIndex; |
| 39 | private transient Map<String, Note> noteIndex; |
| 40 | private transient Map<String, Source> sourceIndex; |
| 41 | private transient Map<String, Repository> repositoryIndex; |
| 42 | private transient Map<String, Submitter> submitterIndex; |
| 43 | |
| 44 | public Header getHeader() { |
| 45 | return head; |
| 46 | } |
| 47 | |
| 48 | public void setHeader(Header head) { |
| 49 | this.head = head; |
| 50 | } |
| 51 | |
| 52 | public List<Person> getPeople() { |
| 53 | return people != null ? people : Collections.<Person>emptyList(); |
| 54 | } |
| 55 | |
| 56 | public Person getPerson(String id) { |
| 57 | return personIndex.get(id); |
| 58 | } |
| 59 | |
| 60 | public void setPeople(List<Person> people) { |
| 61 | this.people = people; |
| 62 | } |
| 63 | |
| 64 | public void addPerson(Person person) { |
| 65 | if (people == null) { |
| 66 | people = new ArrayList<Person>(); |
| 67 | } |
| 68 | people.add(person); |
| 69 | if (personIndex != null) { |
| 70 | personIndex.put(person.getId(), person); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | public List<Family> getFamilies() { |
| 75 | return families != null ? families : Collections.<Family>emptyList(); |
| 76 | } |
| 77 | |
| 78 | public Family getFamily(String id) { |
| 79 | return familyIndex.get(id); |
| 80 | } |
| 81 | |
| 82 | public void setFamilies(List<Family> families) { |
nothing calls this directly
no outgoing calls
no test coverage detected