/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pagination;

import com.sun.webui.jsf.component.Hyperlink;
import javax.faces.context.FacesContext;

/**
 *
 * @author lluis
 */
public class Pagina extends Hyperlink{
    private Integer risco_id;
    private Integer valor;
    private Integer page_nr;
    private Boolean previous = false;
    private Boolean next = false;
    
    public Pagina(){
        super();
    }            

    public Object saveState(FacesContext context)
    {
        Object values[] = new Object[7];
        values[0] = super.saveState(context);
        values[1] = getRisco_id();	
        values[2] = getValor();	        
        values[3] = getPage_nr();	        
        values[4] = isPrevious();	
        values[5] = isNext();		
//        values[2] = getId();        
        return ((Object) (values));
    }
    
    public void restoreState(FacesContext context, Object state)
    {
        Object values[] = (Object[])state;
        super.restoreState(context, values[0]);
	risco_id = (Integer)values[1];
        valor = (Integer)values[2];
	page_nr = (Integer)values[3];        
	previous = (Boolean)values[4];	
	next = (Boolean)values[5];
    }        
    
    public Integer getRisco_id() {
        return risco_id;
    }

    public void setRisco_id(Integer risco_id) {
        this.risco_id = risco_id;
    }

    public Boolean isPrevious() {
        return previous;
    }

    public void setPrevious(Boolean previous) {
        this.previous = previous;
    }

    public Boolean isNext() {
        return next;
    }

    public void setNext(Boolean next) {
        this.next = next;
    }

    public Integer getPage_nr() {
        return page_nr;
    }

    public void setPage_nr(Integer page_nr) {
        this.page_nr = page_nr;
    }

    public Integer getValor() {
        return valor;
    }

    public void setValor(Integer valor) {
        this.valor = valor;
    }
}
