Cleanup ordering, improve API
This commit is contained in:
@@ -8,7 +8,7 @@ private val DEFAULT_LOAD_FACTOR = 0.75f
|
||||
|
||||
library
|
||||
public trait Comparator<T> {
|
||||
fun compare(obj1: T, obj2: T): Int;
|
||||
public fun compare(obj1: T, obj2: T): Int;
|
||||
}
|
||||
|
||||
library
|
||||
|
||||
@@ -2,9 +2,6 @@ package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
library("comparator")
|
||||
public fun comparator<T>(f : (T, T) -> Int): Comparator<T> = noImpl
|
||||
|
||||
library
|
||||
public fun <T> array(vararg value : T): Array<T> = noImpl
|
||||
|
||||
|
||||
@@ -831,29 +831,6 @@
|
||||
compare: throwAbstractFunctionInvocationError("Comparator#compare")
|
||||
});
|
||||
|
||||
/**
|
||||
* @class
|
||||
* @implements {Kotlin.Comparator.<T>}
|
||||
*
|
||||
* @constructor
|
||||
* @param {function(T,T): Boolean} comparator
|
||||
* @template T
|
||||
*/
|
||||
var ComparatorImpl = Kotlin.createClassNow(Kotlin.Comparator,
|
||||
function (comparator) {
|
||||
this.compare = comparator;
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* @param {function(T,T): Boolean} f
|
||||
* @returns {Kotlin.Comparator.<T>}
|
||||
* @template T
|
||||
*/
|
||||
Kotlin.comparator = function (f) {
|
||||
return new ComparatorImpl(f);
|
||||
};
|
||||
|
||||
Kotlin.collectionsMax = function (c, comp) {
|
||||
if (c.isEmpty()) {
|
||||
//TODO: which exception?
|
||||
|
||||
Reference in New Issue
Block a user