package es.ejie.frmk.infraestructura.tablas;

import java.util.Collection;
import java.util.Iterator;

public class Q70TablasCodigosBean {

	//	Lista de opciones
	private Collection optionsCollection = null;

	/**
	 * Obtiene una lista de opciones
	 * @return una colección
	 */
	public Collection getOptionsCollection() {
		return (optionsCollection);
	}

	/**
	 * Establece una lista de opciones
	 * @param optionsCollection lista de opciones
	 */
	public void setOptionsCollection(Collection optionsCollection) {
		this.optionsCollection = optionsCollection;
	}
	

	//Lista de opciones seleccionadas
	private Collection selectedOptionsCollection = null;	

	/**
	 * Obtiene una lista de las opciones seleccionadas
	 * @return una colección
	 */
	public Collection getSelectedOptionsCollection() {
		return (this.selectedOptionsCollection);
	}

	/**
	 * Establece una lista de las opciones seleccionadas
	 * @param selectedOptionsCollection lsta de opciones seleccionadas
	 */
	public void setSelectedOptionsCollection(Collection selectedOptionsCollection) {
		this.selectedOptionsCollection = selectedOptionsCollection;			
	}	
	
	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		StringBuffer sb = new StringBuffer("Q70TablasCodigosBean[options=(");
		
		try{		
		
			if (null!=this.optionsCollection && !this.optionsCollection.isEmpty()) 
			{
				for(Iterator it=this.optionsCollection.iterator();it.hasNext();){
					sb.append(it.next().toString()).append(",");
				}		
				if (sb.length()>("Q70TablasCodigosBean[options=(").length()-1)
					sb.delete(sb.length()-1,sb.length());
			}
				
			sb.append("),selectedOptions=(");
			if (null!=this.selectedOptionsCollection && !this.selectedOptionsCollection.isEmpty()) 
			{
				for(Iterator it=this.selectedOptionsCollection.iterator();it.hasNext();){
					sb.append(it.next().toString()).append(",");
				}								
				if (sb.substring(sb.length()-1,sb.length()).equals(","))
					sb.delete(sb.length()-1,sb.length());
			}
			sb.append(")]");
		
		}catch(Exception ex){
		}
		
		return (sb.toString());		
	}
	
	
}
