public class ConstantDimensionSelector extends Object implements SingleValueHistoricalDimensionSelector, IdLookup
CARDINALITY_UNKNOWN
Constructor and Description |
---|
ConstantDimensionSelector(String value) |
Modifier and Type | Method and Description |
---|---|
Class |
classOfObject() |
Object |
getObject() |
IndexedInts |
getRow()
Gets all values for the row inside of an IntBuffer.
|
IndexedInts |
getRow(int offset) |
int |
getRowValue(int offset) |
int |
getValueCardinality()
Value cardinality is the cardinality of the different occurring values.
|
IdLookup |
idLookup()
Returns
IdLookup if available for this DimensionSelector, or null. |
void |
inspectRuntimeShape(RuntimeShapeInspector inspector)
Implementations of this method should call
inspector.visit() with all fields of this class, which meet two
conditions:
1. |
int |
lookupId(String name)
Inverse of
DimensionSelector.lookupName(int) . |
String |
lookupName(int id)
The Name is the String name of the actual field.
|
ValueMatcher |
makeValueMatcher(com.google.common.base.Predicate<String> predicate) |
ValueMatcher |
makeValueMatcher(String matchValue) |
boolean |
nameLookupPossibleInAdvance()
Returns true if it is possible to
DimensionSelector.lookupName(int) by ids from 0 to DimensionSelector.getValueCardinality()
before the rows with those ids are returned. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
defaultGetObject, getDouble, getFloat, getLong
public ConstantDimensionSelector(String value)
public IndexedInts getRow()
DimensionSelector
getRow
in interface DimensionSelector
public int getRowValue(int offset)
getRowValue
in interface SingleValueHistoricalDimensionSelector
public IndexedInts getRow(int offset)
getRow
in interface HistoricalDimensionSelector
public ValueMatcher makeValueMatcher(String matchValue)
makeValueMatcher
in interface DimensionSelector
matchValue
- nullable dimension valuepublic ValueMatcher makeValueMatcher(com.google.common.base.Predicate<String> predicate)
makeValueMatcher
in interface DimensionSelector
public int getValueCardinality()
DimensionSelector
getValueCardinality
in interface DimensionSelector
public String lookupName(int id)
DimensionSelector
lookupName
in interface DimensionSelector
id
- id to lookup the field name forpublic boolean nameLookupPossibleInAdvance()
DimensionSelector
DimensionSelector.lookupName(int)
by ids from 0 to DimensionSelector.getValueCardinality()
before the rows with those ids are returned.
Returns false if DimensionSelector.lookupName(int)
could be called with ids, returned from the most recent call of DimensionSelector.getRow()
on this DimensionSelector, but not earlier. If DimensionSelector.getValueCardinality()
of this DimensionSelector
additionally returns DimensionSelector.CARDINALITY_UNKNOWN
, lookupName()
couldn't be called with ids, returned by
not the most recent call of DimensionSelector.getRow()
, i. e. names for ids couldn't be looked up "later". If DimensionSelector.getValueCardinality()
returns a non-negative number, lookupName()
could be called with any ids, returned
from #getRow()
since the creation of this DimensionSelector.
If DimensionSelector.lookupName(int)
is called with an ineligible id, result is undefined: exception could be thrown, or
null returned, or some other random value.
nameLookupPossibleInAdvance
in interface DimensionSelector
@Nullable public IdLookup idLookup()
DimensionSelector
IdLookup
if available for this DimensionSelector, or null.idLookup
in interface DimensionSelector
public int lookupId(String name)
IdLookup
DimensionSelector.lookupName(int)
.@Nullable public Object getObject()
getObject
in interface BaseObjectColumnValueSelector
public Class classOfObject()
classOfObject
in interface BaseObjectColumnValueSelector
public void inspectRuntimeShape(RuntimeShapeInspector inspector)
HotLoopCallee
inspector.visit()
with all fields of this class, which meet two
conditions:
1. They are used in methods of this class, annotated with CalledFromHotLoop
2. They are either:
a. Nullable objects
b. Instances of HotLoopCallee
c. Objects, which don't always have a specific class in runtime. For example, a field of type Set
could be HashSet
or TreeSet
in runtime, depending on how
this instance (the instance on which inspectRuntimeShape() is called) is configured.
d. ByteBuffer or similar objects, where byte order matters
e. boolean flags, affecting branch taking
f. Arrays of objects, meeting any of conditions a-e.inspectRuntimeShape
in interface HotLoopCallee
Copyright © 2011–2018. All rights reserved.