package uk.org.aspellclark.gedcom.model.records;
import java.util.ArrayList;
import java.util.List;
import uk.org.aspellclark.gedcom.model.ChangeDate;
import uk.org.aspellclark.gedcom.model.FamilyEventType;
import uk.org.aspellclark.gedcom.model.LdsSpouseSealing;
import uk.org.aspellclark.gedcom.model.UserReference;
import uk.org.aspellclark.gedcom.model.structures.FamilyEventStructure;
import uk.org.aspellclark.gedcom.model.structures.MultimediaLink;
import uk.org.aspellclark.gedcom.model.structures.NoteStructure;
import uk.org.aspellclark.gedcom.model.structures.SourceCitation;
/**
<pre>FAM_RECORD:=
n @<XREF:FAM>@ FAM {1:1}
+1 RESN <RESTRICTION_NOTICE> {0:1)
+1 <<FAMILY_EVENT_STRUCTURE>> {0:M}
+1 HUSB @<XREF:INDI>@ {0:1}
+1 WIFE @<XREF:INDI>@ {0:1}
+1 CHIL @<XREF:INDI>@ {0:M}
+1 NCHI <COUNT_OF_CHILDREN> {0:1}
+1 SUBM @<XREF:SUBM>@ {0:M}
+1 <<LDS_SPOUSE_SEALING>> {0:M} p.36
+1 REFN <USER_REFERENCE_NUMBER> {0:M}
+2 TYPE <USER_REFERENCE_TYPE> {0:1}
+1 RIN <AUTOMATED_RECORD_ID> {0:1}
+1 <<CHANGE_DATE>> {0:1}
+1 <<NOTE_STRUCTURE>> {0:M}
+1 <<SOURCE_CITATION>> {0:M}
+1 <<MULTIMEDIA_LINK>> {0:M}</pre>
The FAMily record is used to record marriages, common law marriages, and family unions caused by
two people becoming the parents of a child. There can be no more than one HUSB/father and one
WIFE/mother listed in each FAM_RECORD. If, for example, a man participated in more than one
family union, then he would appear in more than one FAM_RECORD. The family record structure
assumes that the HUSB/father is male and WIFE/mother is female.<br/>
The preferred order of the CHILdren pointers within a FAMily structure is chronological by birth.
*/
public class FamRecord extends GedcomRecord {
public String restrictionNotice;
public List<FamilyEventStructure> events = new ArrayList<FamilyEventStructure>();
public String husb;
public String wife;
public List<String> childrenXRef = new ArrayList<String>();
public int nbrChildren;
public List<String> submXRef;
public List<LdsSpouseSealing> ldsSpouseSealing;
public List<UserReference> refn;
public String rin;
public ChangeDate changeDate;
public List<NoteStructure> note;
public List<SourceCitation> sourceCitation;
public List<MultimediaLink> multimediaLink;
/**
* @param idFromString
*/
public FamRecord(String idFromString) {
this.xref = idFromString;
}
public CharSequence getDivorceDate() {
String dobStr = "";
for (FamilyEventStructure ie : this.events) {
if (ie.type != null && ie.type.equalsIgnoreCase(FamilyEventType.DIVORCE.tag)) {
if (ie.detail.eventDetail.date != null) {
dobStr = ie.detail.eventDetail.date;
}
}
}
return dobStr;
}
public CharSequence getMarriageDate() {
String dobStr = "";
for (FamilyEventStructure ie : this.events) {
if (ie.type != null && ie.type.equalsIgnoreCase(FamilyEventType.MARRIAGE.tag)) {
if (ie.detail.eventDetail.date != null) {
dobStr = ie.detail.eventDetail.date;
}
}
}
return dobStr;
}
}
|