package cn.com.qmth.stmms.ms.commons.utils.excel;

/**
 * Created by zhengmin on 2016/6/22.
 */
public class ColumnSetting implements Comparable<ColumnSetting> {

    private String header;
    private String fieldName;
    private int width;
    private int index;

    public ColumnSetting(String header,String fieldName, int width, int index) {
        this.header = header;
        this.fieldName = fieldName;
        this.width = width;
        this.index = index;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	@Override
    public int compareTo(ColumnSetting columnSetting) {
        if (index < columnSetting.getIndex())
            return - 1 ;
        if (index > columnSetting.getIndex())
            return 1 ;
        return 0 ;
    }
}
