scoop:scoop.core:0.1.0
src/operators_access.scoop
Selected production source · src/operators_access.scoop
1
/**2
* The generic operator contract used for `a[index]`. Operand and result types are chosen by the3
* implementation.4
*/5
public interface IndexGet<Index, Value> {6
/**7
* Implements `a[index]` for this receiver; domain restrictions and failure behavior belong to8
* the implementing type.9
*/10
public operator fun get(index: Index): Value11
}13
/**14
* The generic operator contract used for `a[index] = value`. Operand and result types are chosen15
* by the implementation.16
*/17
public interface IndexSet<Index, Value> {18
/**19
* Implements `a[index] = value` for this receiver; domain restrictions and failure behavior20
* belong to the implementing type.21
*/22
public operator fun set(index: Index, value: Value): Unit23
}25
/**26
* The generic operator contract used for `a[first, second]`. Operand and result types are chosen27
* by the implementation.28
*/29
public interface IndexGet2<I, J, Value> {30
/**31
* Implements `a[first, second]` for this receiver; domain restrictions and failure behavior32
* belong to the implementing type.33
*/34
public operator fun get(first: I, second: J): Value35
}37
/**38
* The generic operator contract used for `a[first, second] = value`. Operand and result types are39
* chosen by the implementation.40
*/41
public interface IndexSet2<I, J, Value> {42
/**43
* Implements `a[first, second] = value` for this receiver; domain restrictions and failure44
* behavior belong to the implementing type.45
*/46
public operator fun set(first: I, second: J, value: Value): Unit47
}49
/**50
* The generic operator contract used for `a()`. Operand and result types are chosen by the51
* implementation.52
*/53
public interface Invoke0<Result> {54
/**55
* Implements `a()` for this receiver; domain restrictions and failure behavior belong to the56
* implementing type.57
*/58
public operator fun invoke(): Result59
}61
/**62
* The generic operator contract used for `a(argument)`. Operand and result types are chosen by the63
* implementation.64
*/65
public interface Invoke<Arg, Result> {66
/**67
* Implements `a(argument)` for this receiver; domain restrictions and failure behavior belong68
* to the implementing type.69
*/70
public operator fun invoke(argument: Arg): Result71
}73
/**74
* The generic operator contract used for `a(first, second)`. Operand and result types are chosen75
* by the implementation.76
*/77
public interface Invoke2<A, B, Result> {78
/**79
* Implements `a(first, second)` for this receiver; domain restrictions and failure behavior80
* belong to the implementing type.81
*/82
public operator fun invoke(first: A, second: B): Result83
}85
/**86
* The generic operator contract used for `the first destructured component`. Operand and result87
* types are chosen by the implementation.88
*/89
public interface Component1<Result> {90
/**91
* Implements `the first destructured component` for this receiver; domain restrictions and92
* failure behavior belong to the implementing type.93
*/94
public operator fun component1(): Result95
}97
/**98
* The generic operator contract used for `the second destructured component`. Operand and result99
* types are chosen by the implementation.100
*/101
public interface Component2<Result> {102
/**103
* Implements `the second destructured component` for this receiver; domain restrictions and104
* failure behavior belong to the implementing type.105
*/106
public operator fun component2(): Result107
}