tech.tablesaw.filtering.text.TextIsEmpty Maven / Gradle / Ivy
package tech.tablesaw.filtering.text;
import javax.annotation.concurrent.Immutable;
import tech.tablesaw.api.CategoryColumn;
import tech.tablesaw.api.Table;
import tech.tablesaw.columns.Column;
import tech.tablesaw.columns.ColumnReference;
import tech.tablesaw.filtering.ColumnFilter;
import tech.tablesaw.util.Selection;
/**
* A filtering that selects cells in which all text is lowercase
*/
@Immutable
public class TextIsEmpty extends ColumnFilter {
public TextIsEmpty(ColumnReference reference) {
super(reference);
}
@Override
public Selection apply(Table relation) {
Column column = relation.column(columnReference().getColumnName());
CategoryColumn textColumn = (CategoryColumn) column;
return textColumn.empty();
}
}