com.fluxtion.runtime.dataflow.groupby.GroupByView Maven / Gradle / Ivy
package com.fluxtion.runtime.dataflow.groupby;
import java.util.Collection;
import java.util.Map;
public class GroupByView implements GroupBy {
private KeyValue keyValue;
private GroupBy groupBy;
public GroupByView() {
}
public GroupByView(KeyValue keyValue, GroupBy groupBy) {
this.keyValue = keyValue;
this.groupBy = groupBy;
}
public KeyValue getKeyValue() {
return keyValue;
}
public void setKeyValue(KeyValue keyValue) {
this.keyValue = keyValue;
}
public GroupBy getGroupBy() {
return groupBy;
}
public void setGroupBy(GroupBy groupBy) {
this.groupBy = groupBy;
}
@Override
public V lastValue() {
return keyValue.getValue();
}
@Override
public KeyValue lastKeyValue() {
return keyValue;
}
@Override
public Map toMap() {
return groupBy.toMap();
}
@Override
public Collection values() {
return groupBy.values();
}
public void reset() {
groupBy = GroupBy.emptyCollection();
keyValue = GroupBy.emptyKey();
}
}