io.deephaven.engine.table.impl.sources.UngroupedBoxedBooleanArrayColumnSource 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.engine.table.ColumnSource;
import io.deephaven.engine.table.impl.MutableColumnSourceGetDefaults;
public class UngroupedBoxedBooleanArrayColumnSource extends UngroupedColumnSource implements MutableColumnSourceGetDefaults.ForBoolean {
private ColumnSource innerSource;
@Override
public Class> getComponentType() {
return null;
}
public UngroupedBoxedBooleanArrayColumnSource(ColumnSource innerSource) {
super(Boolean.class);
this.innerSource = innerSource;
}
@Override
public Boolean get(long rowKey) {
if (rowKey < 0) {
return null;
}
long segment = rowKey >>base;
int offset = (int) (rowKey & ((1< = array.length) {
return null;
}
return array[offset];
}
@Override
public Boolean getPrev(long rowKey) {
if (rowKey < 0) {
return null;
}
long segment = rowKey >> getPrevBase();
int offset = (int) (rowKey & ((1<< getPrevBase()) - 1));
Boolean[] array = innerSource.getPrev(segment);
if(offset >= array.length) {
return null;
}
return array[offset];
}
@Override
public boolean isImmutable() {
return innerSource.isImmutable();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy