/*
 *  The MIT License (MIT)
 *
 *  View the full license at:
 *  https://github.com/hendrixjoseph/FamilyTree/blob/master/LICENSE.md
 *
 *  Copyright (c) 2015 Joseph Hendrix
 *
 *  Hosted on GitHub at https://github.com/hendrixjoseph/FamilyTree
 *
 */

package edu.wright.hendrix11.familyTree.bean.mining;

import edu.wright.hendrix11.familyTree.dataBean.mining.NamesDataBean;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.view.ViewScoped;
import javax.inject.Named;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;

/**
 * @author Joe Hendrix
 */
@Named
@ViewScoped
public class NamesBean implements Serializable
{
    private static Logger LOG = Logger.getLogger(NamesBean.class.getName());

    @EJB
    NamesDataBean dataBean;
    Map<String, Integer> firstNameFrequency;
    Map<String, Integer> lastNameFrequency;

    @PostConstruct
    private void initialize()
    {
        firstNameFrequency = dataBean.firstNameFrequency();
        lastNameFrequency = dataBean.lastNameFrequency();
    }

    public Map<String, Integer> getFirstNameFrequency()
    {
        return firstNameFrequency;
    }

    public Map<String, Integer> getLastNameFrequency()
    {
        return lastNameFrequency;
    }

    public List<Map.Entry<String, Integer>> getFirstNameFrequencyList()
    {
        return new ArrayList(firstNameFrequency.entrySet());
    }

    public List<Map.Entry<String, Integer>> getLastNameFrequencyList()
    {
        return new ArrayList(lastNameFrequency.entrySet());
    }
}

@@ -1119,191 +1119,452 @@
   %7D%0A
+    
 %0A    
-public Map%3CString, Integer%3E getFirstNameFrequency()%0A    %7B%0A        return firstNameFrequency;%0A    %7D%0A%0A    public Map%3CString, Integer%3E getLastNameFrequency()%0A
+/**%0A     * Returns a list of first names to the number of occurences (frequency) of that name.%0A     * %3Cp%3E%0A     * These values are first put into a %7B@link LinkedHashMap%7D then converted into a%0A     * %7B@link List%7D of %7B@link Map.Entry%7D. This is to allow use in PrimeFaces' datatable %0A     * JSF element.%0A     * %0A     * @return a list of first names to the number of occurences (frequency) of that name%0A 
     
-%7B
+* 
 %0A     
-   return la
+* @see NamesDataBean#fir
 stNa
@@ -1574,24 +1574,24 @@
 requency
-;
 %0A    
-%7D%0A
+ */
 %0A    pub
@@ -1729,16 +1729,475 @@
 %0A    %7D%0A%0A
+    /**%0A     * Returns a list of last names to the number of occurences (frequency) of that name.%0A     * %3Cp%3E%0A     * These values are last put into a %7B@link LinkedHashMap%7D then converted into a%0A     * %7B@link List%7D of %7B@link Map.Entry%7D. This is to allow use in PrimeFaces' datatable %0A     * JSF element.%0A     * %0A     * @return a list of last names to the number of occurences (frequency) of that name%0A     * %0A     * @see NamesDataBean#lastNameFrequency%0A     */%0A
     publ

Update NamesBean.java