io.deephaven.engine.table.impl.sources.AbstractDeferredGroupingColumnSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-engine-table Show documentation
Show all versions of deephaven-engine-table Show documentation
Engine Table: Implementation and closely-coupled utilities
/**
* Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
*/
package io.deephaven.engine.table.impl.sources;
import io.deephaven.base.Pair;
import io.deephaven.engine.table.impl.AbstractColumnSource;
import io.deephaven.engine.table.impl.locations.GroupingProvider;
import io.deephaven.engine.rowset.RowSet;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
/**
* Adds deferred grouping support to {@link AbstractColumnSource}.
*/
public abstract class AbstractDeferredGroupingColumnSource extends AbstractColumnSource
implements DeferredGroupingColumnSource {
private transient volatile GroupingProvider groupingProvider;
protected AbstractDeferredGroupingColumnSource(Class type) {
super(type, null);
}
protected AbstractDeferredGroupingColumnSource(Class type, Class> componentType) {
super(type, componentType);
}
@Override
public GroupingProvider getGroupingProvider() {
return groupingProvider;
}
/**
* Set a grouping provider for use in lazily-constructing groupings.
*
* @param groupingProvider The {@link GroupingProvider} to use
*/
@Override
public final void setGroupingProvider(@Nullable GroupingProvider groupingProvider) {
this.groupingProvider = groupingProvider;
}
@Override
public final Map getGroupToRange() {
if (groupToRange == null && groupingProvider != null) {
groupToRange = groupingProvider.getGroupToRange();
groupingProvider = null;
}
return groupToRange;
}
@Override
public final Map getGroupToRange(RowSet rowSet) {
if (groupToRange == null && groupingProvider != null) {
Pair
© 2015 - 2024 Weber Informatics LLC | Privacy Policy