public class ComparatorDimensionDictionary<T> extends Object
Comparator
based DimensionDictionary
there are a lot of unused methods in here for now since the only thing this is used for is to build up
the unsorted dictionary and then it is converted to a ComparatorSortedDimensionDictionary
, but
leaving the unused methods in place for now to be basically compatible with the other implementation.
This version is not thread-safe since the only current user doesn't use the dictionary for realtime queries, if this
changes we need to add a 'ConcurrentComparatorDimensionDictionary'.Modifier and Type | Field and Description |
---|---|
static int |
ABSENT_VALUE_ID |
Constructor and Description |
---|
ComparatorDimensionDictionary(Comparator<T> comparator) |
Modifier and Type | Method and Description |
---|---|
int |
add(T originalValue) |
long |
estimateSizeOfValue(T value)
Estimates the size of the dimension value in bytes.
|
int |
getId(T value) |
int |
getIdForNull() |
T |
getMaxValue() |
T |
getMinValue() |
T |
getValue(int id) |
int |
size() |
long |
sizeInBytes()
Gets the current size of this dictionary in bytes.
|
ComparatorSortedDimensionDictionary<T> |
sort() |
public static final int ABSENT_VALUE_ID
public ComparatorDimensionDictionary(Comparator<T> comparator)
public int size()
public long sizeInBytes()
IllegalStateException
- if size computation is disabled.public T getMinValue()
public T getMaxValue()
public int getIdForNull()
public ComparatorSortedDimensionDictionary<T> sort()
public long estimateSizeOfValue(T value)
UnsupportedOperationException
- Implementations that want to estimate
memory must override this method.Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.