AbstractColumn implements Column<T> { @Override @SuppressWarnings({"unchecked", "rawtypes"}) public C first(int numRows) { return (C) Column.super.first(numRows); } AbstractColumn(ColumnType type, final String name); @Override String name(); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C setName(final String name); @Override ColumnType type(); @Override abstract Column<T> emptyCopy(); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C filter(Predicate<? super T> test); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C sorted(Comparator<? super T> comp); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C map(Function<? super T, ? extends T> fun); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C min(Column<T> other); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C max(Column<T> other); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C set(Selection condition, Column<T> other); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C set(Selection rowSelection, T newValue); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C first(int numRows); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C last(int numRows); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C sampleN(int n); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C sampleX(double proportion); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C subset(int[] rows); @Override @SuppressWarnings({"unchecked", "rawtypes"}) C inRange(int start, int end); @Override String toString(); @Override StringColumn asStringColumn(); @Override int indexOf(final Object o); static final int DEFAULT_ARRAY_SIZE; }
@Test public void doWithEach() throws Exception { Table table = Table.read().csv("../data/bush.csv").first(5); DateColumn dc1 = table.dateColumn("date"); DateColumn dc2 = DateColumn.create("100 days later"); dc1.forEach(localDate -> dc2.append(localDate.plusDays(100))); assertEquals(dc1.get(0).plusDays(100), dc2.get(0)); }