package org.schoellerfamily.gedbrowser.analytics.visitor;

import java.util.ArrayList;
import java.util.List;

import org.schoellerfamily.gedbrowser.datamodel.Attribute;
import org.schoellerfamily.gedbrowser.datamodel.Child;
import org.schoellerfamily.gedbrowser.datamodel.visitor.GedObjectVisitor;

/**
 * Implements behaviors shared by Person and Family analysis visitors.
 *
 * @author Dick Schoeller
 */
public abstract class AbstractAnalysisVisitor extends IgnoreableProcessor
        implements GedObjectVisitor {
    /** */
    private final List<Attribute> attributes = new ArrayList<>();
    /** */
    private final List<Attribute> trimmedAttributes = new ArrayList<>();
    /** */
    private final List<Child> children = new ArrayList<>();

    /**
     * Constructor.
     */
    public AbstractAnalysisVisitor() {
        super();
    }

    /**
     * @return the list of all attributes
     */
    public List<Attribute> getAttributes() {
        return attributes;
    }

    /**
     * @return the list of attributes that are interesting
     */
    public List<Attribute> getTrimmedAttributes() {
        return trimmedAttributes;
    }

    /**
     * @return the list of attributes that are interesting
     */
    public List<Child> getChildren() {
        return children;
    }

    /**
     * Visit an Attribute. Track the complete list of Attributes and a list
     * trimmed by removing "ignoreable" attributes.
     *
     * @see GedObjectVisitor#visit(Attribute)
     */
    @Override
    public void visit(final Attribute attribute) {
        attributes.add(attribute);
        if (ignoreable(attribute)) {
            return;
        }
        trimmedAttributes.add(attribute);
    }

    /**
     * Visit a Child. The list of children may be used by the calling
     * algorithm.
     *
     * @see GedObjectVisitor#visit(Child)
     */
    @Override
    public void visit(final Child child) {
        children.add(child);
    }
}

@@ -906,32 +906,38 @@
   */%0A    public 
+final 
 List%3CAttribute%3E 
@@ -946,32 +946,32 @@
 tAttributes() %7B%0A
-
         return a
@@ -1070,24 +1070,30 @@
 %0A    public 
+final 
 List%3CAttribu
@@ -1248,16 +1248,22 @@
  public 
+final 
 List%3CChi
@@ -1528,32 +1528,38 @@
 ride%0A    public 
+final 
 void visit(final
@@ -1892,32 +1892,32 @@
 /%0A    @Override%0A
-
     public void 
@@ -1911,16 +1911,22 @@
  public 
+final 
 void vis

add final to some methods