Skip to content

Commit 60319f4

Browse files
committed
added note about reflection in input handlers
1 parent 36ed245 commit 60319f4

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/AggregatorInputHandler.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ internal interface AggregatorInputHandler<in Value : Any, out Return : Any?> : A
2121
*
2222
* If the specific [ValueType] of the input is not known, but you still want to call [aggregate],
2323
* this function can be called to calculate it by getting the types of [values] at runtime.
24+
* This is heavy because it uses reflection on each value.
2425
*/
2526
fun calculateValueType(values: Sequence<Value?>): ValueType
2627

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/inputHandlers/AnyInputHandler.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ internal class AnyInputHandler<in Value : Any, out Return : Any?> : AggregatorIn
3333
*
3434
* If the specific [ValueType] of the input is not known, but you still want to call [aggregate],
3535
* this function can be called to calculate it in terms of inheritance by getting the types of [values] at runtime.
36+
* This is heavy because it uses reflection on each value.
3637
*/
3738
override fun calculateValueType(values: Sequence<Value?>): ValueType {
3839
var hasNulls = false

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/inputHandlers/NumberInputHandler.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ internal class NumberInputHandler<out Return : Any?> : AggregatorInputHandler<Nu
132132
* If the specific [ValueType] of the input is not known, but you still want to call [aggregate],
133133
* this function can be called to calculate it in terms of [number unification][UnifyingNumbers]
134134
* by getting the types of [values] at runtime.
135+
* This is heavy because it uses reflection on each value.
135136
*
136137
* @throws IllegalArgumentException if the input type is not [Number]`(?)` or a primitive number type.
137138
* @return The (primitive) unified number type of the input values.

0 commit comments

Comments
 (0)