Class NullColumn.Accessor
- java.lang.Object
-
- org.apache.druid.query.rowsandcols.column.NullColumn.Accessor
-
- All Implemented Interfaces:
BinarySearchableAccessor
,ColumnAccessor
- Enclosing class:
- NullColumn
public static class NullColumn.Accessor extends Object implements BinarySearchableAccessor
-
-
Constructor Summary
Constructors Constructor Description Accessor(ColumnType type, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareRows(int lhsRowNum, int rhsRowNum)
Compares two rows using a comparison that follows the same semantics asComparator.compare(T, T)
FindResult
findComplex(int startIndex, int endIndex, Object val)
FindResult
findDouble(int startIndex, int endIndex, double val)
FindResult
findFloat(int startIndex, int endIndex, float val)
FindResult
findLong(int startIndex, int endIndex, long val)
FindResult
findNull(int startIndex, int endIndex)
FindResult
findString(int startIndex, int endIndex, String val)
double
getDouble(int rowNum)
Get the primitivedouble
representation of the row.float
getFloat(int rowNum)
Get the primitivefloat
representation of the row.int
getInt(int rowNum)
Get the primitiveint
representation of the row.long
getLong(int rowNum)
Get the primitivelong
representation of the row.Object
getObject(int rowNum)
Get theObject
representation of the row.ColumnType
getType()
Get the type of the Columnboolean
isNull(int rowNum)
Get whether the value of a row is nullint
numRows()
Get the number of rows
-
-
-
Constructor Detail
-
Accessor
public Accessor(ColumnType type, int size)
-
-
Method Detail
-
getType
public ColumnType getType()
Description copied from interface:ColumnAccessor
Get the type of the Column- Specified by:
getType
in interfaceColumnAccessor
- Returns:
- the type of the Column
-
numRows
public int numRows()
Description copied from interface:ColumnAccessor
Get the number of rows- Specified by:
numRows
in interfaceColumnAccessor
- Returns:
- the number of rows
-
isNull
public boolean isNull(int rowNum)
Description copied from interface:ColumnAccessor
Get whether the value of a row is null- Specified by:
isNull
in interfaceColumnAccessor
- Parameters:
rowNum
- the row id, 0-indexed- Returns:
- true if the value is null
-
getObject
@Nullable public Object getObject(int rowNum)
Description copied from interface:ColumnAccessor
Get theObject
representation of the row.- Specified by:
getObject
in interfaceColumnAccessor
- Parameters:
rowNum
- the row id, 0-indexed- Returns:
- the
Object
representation of the row. Returnsnull
IfColumnAccessor.isNull(int)
is true.
-
getDouble
public double getDouble(int rowNum)
Description copied from interface:ColumnAccessor
Get the primitivedouble
representation of the row.- Specified by:
getDouble
in interfaceColumnAccessor
- Parameters:
rowNum
- the row id, 0-indexed- Returns:
- the primitive
double
representation of the row. Returns0D
IfColumnAccessor.isNull(int)
is true.
-
getFloat
public float getFloat(int rowNum)
Description copied from interface:ColumnAccessor
Get the primitivefloat
representation of the row.- Specified by:
getFloat
in interfaceColumnAccessor
- Parameters:
rowNum
- the row id, 0-indexed- Returns:
- the primitive
float
representation of the row. Returns0F
IfColumnAccessor.isNull(int)
is true.
-
getLong
public long getLong(int rowNum)
Description copied from interface:ColumnAccessor
Get the primitivelong
representation of the row.- Specified by:
getLong
in interfaceColumnAccessor
- Parameters:
rowNum
- the row id, 0-indexed- Returns:
- the primitive
long
representation of the row. Returns0L
IfColumnAccessor.isNull(int)
is true.
-
getInt
public int getInt(int rowNum)
Description copied from interface:ColumnAccessor
Get the primitiveint
representation of the row.- Specified by:
getInt
in interfaceColumnAccessor
- Parameters:
rowNum
- the row id, 0-indexed- Returns:
- the primitive
int
representation of the row. Returns0
IfColumnAccessor.isNull(int)
is true.
-
compareRows
public int compareRows(int lhsRowNum, int rhsRowNum)
Description copied from interface:ColumnAccessor
Compares two rows using a comparison that follows the same semantics asComparator.compare(T, T)
This is not comparing the row Ids, but the values referred to by the row ids.
- Specified by:
compareRows
in interfaceColumnAccessor
- Parameters:
lhsRowNum
- the row id of the left-hand-side of the comparisonrhsRowNum
- the row id of the right-hand-side of the comparison- Returns:
- the result of the comparison of the two rows
-
findNull
public FindResult findNull(int startIndex, int endIndex)
- Specified by:
findNull
in interfaceBinarySearchableAccessor
-
findDouble
public FindResult findDouble(int startIndex, int endIndex, double val)
- Specified by:
findDouble
in interfaceBinarySearchableAccessor
-
findFloat
public FindResult findFloat(int startIndex, int endIndex, float val)
- Specified by:
findFloat
in interfaceBinarySearchableAccessor
-
findLong
public FindResult findLong(int startIndex, int endIndex, long val)
- Specified by:
findLong
in interfaceBinarySearchableAccessor
-
findString
public FindResult findString(int startIndex, int endIndex, String val)
- Specified by:
findString
in interfaceBinarySearchableAccessor
-
findComplex
public FindResult findComplex(int startIndex, int endIndex, Object val)
- Specified by:
findComplex
in interfaceBinarySearchableAccessor
-
-