/*
 *  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;

import edu.wright.hendrix11.familyTree.dataBean.DataBean;

import java.util.List;

/**
 * @param <E>
 *
 * @author Joe Hendrix
 */
public abstract class AbstractBean<E>
{

    private DataBean<E, ?> dataBean;

    /**
     *
     */
    protected abstract void initialize();

    /**
     * @param dataBean
     */
    protected void initialize(DataBean<E, ?> dataBean)
    {
        this.dataBean = dataBean;
    }

    /**
     * @return
     */
    public List<E> getEntities()
    {
        return dataBean.list();
    }

    /**
     * @return
     */
    public int getPage()
    {
        return dataBean.getPage();
    }

    /**
     * @param page
     */
    public void setPage(int page)
    {
        dataBean.setPage(page);
    }

    /**
     * @return
     */
    public int getNumPages()
    {
        return dataBean.getNumPages();
    }
}

/*
 *  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;

import edu.wright.hendrix11.familyTree.dataBean.DataBean;

import java.util.List;

/**
 * @param <E>
 *
 * @author Joe Hendrix
 */
public abstract class AbstractBean<E>
{

    private DataBean<E, ?> dataBean;

    protected abstract void initialize();

    protected void initialize(DataBean<E, ?> dataBean)
    {
        this.dataBean = dataBean;
    }

    /**
     * Returns the list of entities. These entities are specified by the type E.
     * 
     * @return the list of entities
     * 
     * @see DataBean#list
     */
    public List<E> getEntities()
    {
        return dataBean.list();
    }

    /**
     * Returns the current page number.
     * 
     * @return the current page number
     * 
     * @see DataBean#getPage
     */
    public int getPage()
    {
        return dataBean.getPage();
    }

    /**
     * Sets the current page number.
     * 
     * @param page the current page number
     * 
     * @see DataBean#setPage
     */
    public void setPage(int page)
    {
        dataBean.setPage(page);
    }

    /**
     * Returns the total number of pages.
     * 
     * @return the total number of pages
     * 
     * @see DataBean#getNumPages
     */
    public int getNumPages()
    {
        return dataBean.getNumPages();
    }
}

Update AbstractBean.java