/**
 * 
 */
package org.richfaces.sandbox;

import java.util.ArrayList;
import java.util.Collection;

import org.richfaces.model.Ordering;

/**
 * @author Konstantin Mishin
 *
 */
public class Bean {

	private String sortMode;
	private Ordering[] sortOrder;
	private Collection<String> sortPriority;
	
	public Bean() {
		sortOrder = new Ordering[4];
		clearSortOrder();
		sortPriority = new ArrayList<String>();
	}

	private void clearSortOrder() {
		for (int i = 0; i < sortOrder.length; i++) {
			sortOrder[i] = Ordering.UNSORTED;
		}
	}

	public String getSortMode() {
		return sortMode;
	}

	public void setSortMode(String sortMode) {
		this.sortMode = sortMode;
	}

	public Collection<String> getSortPriority() {
		return sortPriority;
	}

	public void setSortPriority(Collection<String> sortPriority) {
		this.sortPriority = sortPriority;
	}
	
	public void clearSortPriority() {
		sortPriority.clear();
		clearSortOrder();
	}

	public Ordering[] getSortOrder() {
		return sortOrder;
	}

	public void setSortOrder(Ordering[] sortOrder) {
		this.sortOrder = sortOrder;
	}
}
