Cleanup ordering, improve API

This commit is contained in:
Ilya Ryzhenkov
2014-11-07 17:07:35 +03:00
parent e890c2ee0d
commit 828ba385ea
13 changed files with 208 additions and 194 deletions
+1 -1
View File
@@ -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
-3
View File
@@ -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
-23
View File
@@ -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?