All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.data.exploration.biz.datatable.column.IntegerColumn Maven / Gradle / Ivy

The newest version!
package com.datastax.data.exploration.biz.datatable.column;

import com.datastax.data.exploration.biz.datatable.DataType;
import com.datastax.data.exploration.biz.datatable.column.math.MathStat;

/**
 * 整数属性列
 */
public class IntegerColumn extends NumberColumn {

    private MathStat stat = null;

    public IntegerColumn(String columnName) {
        super(columnName, DataType.INT);
    }

    @Override
    Integer transferValue(String str) {
        try {
            return Integer.valueOf(str);
        } catch (Exception e) {
            addError(ERROR_TYPE, str);
            return null;
        }
    }

    @Override
    void flush() {
        this.stat = null;
    }

    public MathStat getStat() {
        if (stat == null) {
            stat = new MathStat<>(getNotNullValues().toArray(new Integer[0]));
        }
        return stat;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy