Package org.gedcom4j.model

Examples of org.gedcom4j.model.Individual


     */
    @Test
    public void testIndividual1() {
        Relationship r1 = new Relationship();
        Relationship r2 = new Relationship();
        r1.individual1 = new Individual();
        assertFalse(r1.equals(r2));
        assertFalse(r1.hashCode() == r2.hashCode());
        r2.individual1 = new Individual();
        assertTrue(r1.equals(r2));
        assertTrue(r1.hashCode() == r2.hashCode());
    }
View Full Code Here


     */
    @Test
    public void testIndividual2() {
        Relationship r1 = new Relationship();
        Relationship r2 = new Relationship();
        r1.individual2 = new Individual();
        assertFalse(r1.equals(r2));
        assertFalse(r1.hashCode() == r2.hashCode());
        r2.individual2 = new Individual();
        assertTrue(r1.equals(r2));
        assertTrue(r1.hashCode() == r2.hashCode());
    }
View Full Code Here

    @Test
    public void testToString() {
        Relationship r = new Relationship();
        assertEquals("<>, 0 step(s)", r.toString());

        r.individual1 = new Individual();
        r.individual2 = new Individual();
        SimpleRelationship sr = new SimpleRelationship();
        sr.name = RelationshipName.FATHER;
        sr.reverseName = RelationshipName.SON;
        sr.individual1 = r.individual1;
        sr.individual2 = r.individual2;
View Full Code Here

        Set<Individual> result = new HashSet<Individual>();

        // Get every family this individual was a child of
        for (FamilyChild fc : individual.familiesWhereChild) {
            // Add father and all his wives
            Individual dad = fc.family.husband;
            if (dad != null && !result.contains(dad)) {
                result.add(dad);
                for (FamilySpouse fs : dad.familiesWhereSpouse) {
                    Individual dadsWife = fs.family.wife;
                    if (dadsWife != null) {
                        result.add(dadsWife);
                        result.addAll(getExtendedAncestry(dadsWife));
                    }
                }
                // And include his extended ancestry as well (recursively)
                result.addAll(getExtendedAncestry(dad));
            }

            // Add mother and all her husbands
            Individual mom = fc.family.wife;
            if (mom != null && !result.contains(mom)) {
                result.add(mom);
                for (FamilySpouse fs : mom.familiesWhereSpouse) {
                    Individual momsHusband = fs.family.husband;
                    if (momsHusband != null) {
                        result.add(momsHusband);
                        result.addAll(getExtendedAncestry(momsHusband));
                    }
                }
View Full Code Here

        if (!addedAnyCommonAncestors) {
            // we didn't find any common ancestors, so recurse up this
            // individual's parents
            for (FamilyChild fc : individual.familiesWhereChild) {
                Individual dad = fc.family.husband;
                if (dad != null && !checkedAlready.contains(dad)) {
                    addLowestCommonAncestorsToSet(dad, set, level + 1);
                }
                Individual mom = fc.family.wife;
                if (mom != null && !checkedAlready.contains(mom)) {
                    addLowestCommonAncestorsToSet(mom, set, level + 1);
                }
            }
        }
View Full Code Here

            addedAnyCommonAncestors = true;
            return;
        }
        // Dad isn't in common, check his spouses
        for (FamilySpouse fs : parent.familiesWhereSpouse) {
            Individual spouse = getSpouse(fs, parent);
            if (spouse == null) {
                continue;
            }
            if (targetList.contains(spouse)) {
                // Dad's wife is in common, add to result set
View Full Code Here

     * Set up test fixtures
     */
    @Before
    public void setUp() {
        c = new IndividualByLastNameFirstNameComparator();
        i1 = new Individual();
        i2 = new Individual();
    }
View Full Code Here

     */
    @Before
    public void setUp() {
        sr1 = new SimpleRelationship();
        sr2 = new SimpleRelationship();
        sr1.individual1 = new Individual();
        sr2.individual1 = new Individual();
        sr1.individual2 = new Individual();
        sr2.individual2 = new Individual();
        PersonalName n = new PersonalName();
        n.basic = "Bill";
        sr1.individual1.names.add(n);
        n = new PersonalName();
        n.basic = "Sam";
View Full Code Here

    @Test
    public void testOne() {
        Gedcom g = TestHelper.getMinimalGedcom();
        rootValidator.gedcom = g;

        Individual i = new Individual();
        i.xref = "@I00001@";
        g.individuals.put(i.xref, i);

        PersonalName pn = new PersonalName();
        i.names.add(pn);
View Full Code Here

        assertNotNull(g);
        assertTrue(gp.errors.isEmpty());
        assertEquals("Two tags had descriptions where [Y|<NULL>] belonged", 2, gp.warnings.size());
        assertFalse(g.individuals.isEmpty());
        assertEquals(1, g.individuals.size());
        Individual i = g.individuals.values().iterator().next();
        assertNotNull(i);
        assertEquals(4, i.events.size());
        birth = i.events.get(0);
        assertNotNull(birth);
        cremation = i.events.get(1);
View Full Code Here

TOP

Related Classes of org.gedcom4j.model.Individual

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.