diff --git a/versions/snapshot/apidocs/allclasses-frame.html b/versions/snapshot/apidocs/allclasses-frame.html index 9750a3e39ee4c..c15bfc9812e8f 100644 --- a/versions/snapshot/apidocs/allclasses-frame.html +++ b/versions/snapshot/apidocs/allclasses-frame.html @@ -2,7 +2,7 @@
- +map(transform: (T) -> R): List<R>
mapTo(result: C, transform: (T) -> R): C
-fun <T, C>
Iterable<T>
to(result: C): C
+toCollection(): Collection<T>
-fun <T>
Iterable<T>
toCollection(): Collection<T>
+toCollection(result: C): C
fun <T, R> Iterable<T>.map(transform: (T) -> R): List<R>-
Returns a new List containing the results of applying the given function to each element in this collection
+Returns a new List containing the results of applying the given transform function to each element in this collection
val
data
=
arrayList
(
"
foo
"
,
"
bar
"
)
val
lengths
=
data
.
map
<
String
,
Int
>
{
it
.
length
}
assertTrue
{
@@ -1177,13 +1177,13 @@
fun <T, R, C> Iterable<T>.mapTo(result: C, transform: (T) -> R): C-
Transforms each element of this collection with the given function then adds the results to the given collection
+Transforms each element of this collection with the given transform function and
adds each return value to the given results collection
Returns a list containing the first elements that satisfy the given predicate
- - fun <T, C> Iterable<T>.to(result: C): C-
Copies all elements into the given collection
-+ + fun <T, C> Iterable<T>.toCollection(result: C): C+
Copies all elements into the given collection
+@@ -1339,7 +1339,7 @@
TODO these functions don’t work when they generate the Array
versions when they are in JLIterables
diff --git a/versions/snapshot/apidocs/kotlin/java/util/Collection-extensions.html b/versions/snapshot/apidocs/kotlin/java/util/Collection-extensions.html index 20ec9e5445517..0253c3c7b46d6 100644 --- a/versions/snapshot/apidocs/kotlin/java/util/Collection-extensions.html +++ b/versions/snapshot/apidocs/kotlin/java/util/Collection-extensions.html @@ -2,7 +2,7 @@ - +java.util.Collection Extensions fom kotlin (Kotlin API (0.1-SNAPSHOT)) @@ -123,33 +123,9 @@
val
-
val
val
-fun <T, C>
Iterable<T>
to(result: C): C
+toArray(): Array<T>
-fun <T>
Collection<T>
toArray(): Array<T>
+toCollection(): Collection<T>
-fun <T>
Iterable<T>
toCollection(): Collection<T>
+toCollection(result: C): C
Transforms each element of this collection with the given transform function and
adds each return value to the given results collection
@@ -1399,16 +1375,7 @@
Returns a list containing the first elements that satisfy the given predicate
- - fun <T, C> Iterable<T>.to(result: C): C-
Copies all elements into the given collection
-+ + fun <T, C> Iterable<T>.toCollection(result: C): C+
Copies all elements into the given collection
+@@ -1462,7 +1438,7 @@
TODO these functions don’t work when they generate the Array
versions when they are in JLIterables
diff --git a/versions/snapshot/apidocs/kotlin/java/util/Entry-extensions.html b/versions/snapshot/apidocs/kotlin/java/util/Entry-extensions.html index e8867c8782aa3..45b6c1473de81 100644 --- a/versions/snapshot/apidocs/kotlin/java/util/Entry-extensions.html +++ b/versions/snapshot/apidocs/kotlin/java/util/Entry-extensions.html @@ -2,7 +2,7 @@ - +java.util.Entry Extensions fom kotlin (Kotlin API (0.1-SNAPSHOT)) @@ -123,7 +123,7 @@
val
- - +value: V
diff --git a/versions/snapshot/apidocs/kotlin/java/util/Enumeration-extensions.html b/versions/snapshot/apidocs/kotlin/java/util/Enumeration-extensions.html index 1dd1303b445f5..bd380027056f3 100644 --- a/versions/snapshot/apidocs/kotlin/java/util/Enumeration-extensions.html +++ b/versions/snapshot/apidocs/kotlin/java/util/Enumeration-extensions.html @@ -2,7 +2,7 @@ - +java.util.Enumeration Extensions fom kotlin (Kotlin API (0.1-SNAPSHOT)) @@ -151,7 +151,7 @@
- +iterator
diff --git a/versions/snapshot/apidocs/kotlin/java/util/Iterator-extensions.html b/versions/snapshot/apidocs/kotlin/java/util/Iterator-extensions.html index c4cf252afa11a..e9c8a26e11563 100644 --- a/versions/snapshot/apidocs/kotlin/java/util/Iterator-extensions.html +++ b/versions/snapshot/apidocs/kotlin/java/util/Iterator-extensions.html @@ -2,7 +2,7 @@ - +java.util.Iterator Extensions fom kotlin (Kotlin API (0.1-SNAPSHOT)) @@ -604,14 +604,14 @@
+fun <T> -fun <T, C>
Iterator<T>
Iterator<T>to(result: C): C
+toCollection(): Collection<T>
-Copies all elements into the given collection +Copies all elements into a [[List]
-fun <T>
Iterator<T>
toCollection(): Collection<T>
+toCollection(result: C): C
@@ -1184,15 +1184,6 @@
Returns a list containing the first elements that satisfy the given predicate
- - fun <T, C> Iterator<T>.to(result: C): C-
Copies all elements into the given collection
-+ + fun <T, C> Iterator<T>.toCollection(result: C): C+
Copies all elements into the given collection
+val
val
val
to(result: C): C
+toArray(): Array<T>
-fun <T>
Collection<T>
toArray(): Array<T>
+toCollection(): Collection<T>
-fun <T>
Iterable<T>
toCollection(): Collection<T>
+toCollection(result: C): C
Transforms each element of this collection with the given transform function and
adds each return value to the given results collection
@@ -1497,16 +1473,7 @@
Returns a list containing the first elements that satisfy the given predicate
- - fun <T, C> Iterable<T>.to(result: C): C-
Copies all elements into the given collection
-+ + fun <T, C> Iterable<T>.toCollection(result: C): C+
Copies all elements into the given collection
+@@ -1560,7 +1536,7 @@
TODO these functions don’t work when they generate the Array
versions when they are in JLIterables
diff --git a/versions/snapshot/apidocs/kotlin/java/util/Map-extensions.html b/versions/snapshot/apidocs/kotlin/java/util/Map-extensions.html index 142ed33d120f6..f444c3c07502b 100644 --- a/versions/snapshot/apidocs/kotlin/java/util/Map-extensions.html +++ b/versions/snapshot/apidocs/kotlin/java/util/Map-extensions.html @@ -2,7 +2,7 @@ - +java.util.Map Extensions fom kotlin (Kotlin API (0.1-SNAPSHOT)) @@ -110,6 +110,42 @@
+Property Summary | +|
---|---|
+val |
++ | +
+val |
++ | +
+
+
+
+fun <K, V>
Map<K, V>
+
+
+
toLinkedMap(): LinkedHashMap<K, V>
+
+
+
+
+
+fun <K, V>
Map<K, V>
+
+
+
toMap(map: Map<K, V>): Map<K, V>
+
+
+
+
+
+fun <K, V>
Map<K, V>
+
+
+
toSortedMap(): SortedMap<K, V>
+
+
+
+
+
+fun <K, V>
Map<K, V>
+
+
+
toSortedMap(comparator: Comparator<K>): SortedMap<K, V>
+
+@@ -295,7 +395,7 @@
@@ -379,7 +479,7 @@
Transforms each Map.Entry in this Map with the given transform function and
adds each return value to the given results collection
@@ -406,7 +506,7 @@
Populates the given result Map with the value returned by applying the transform function on each Map.Entry in this Map
@@ -424,7 +524,7 @@
Puts all the entries into the map with the first value in the tuple being the key and the second the value
@@ -432,6 +532,60 @@fun <K, V> Map<K, V>.set(key: K, value: V): V?
Provides [] access to maps
+ + fun <K, V> Map<K, V>.toLinkedMap(): LinkedHashMap<K, V>+
Converts this Map to a LinkedHashMap so future insertion orders are maintained
++ + fun <K, V> Map<K, V>.toMap(map: Map<K, V>): Map<K, V>+
Copies the entries in this Map to the given map
++ + fun <K, V> Map<K, V>.toSortedMap(): SortedMap<K, V>+
Converts this Map to a SortedMap so iteration order will be in key order
+
val
map
=
hashMap
<
String
,
Int
>
(
#
(
"
c
"
,
3
)
,
#
(
"
b
"
,
2
)
,
#
(
"
a
"
,
1
)
)
+
val
sorted
=
map
.
toSortedMap
<
String
,
Int
>
(
)
+
assertEquals
(
1
,
sorted
.
get
(
"
a
"
)
)
+
assertEquals
(
2
,
sorted
.
get
(
"
b
"
)
)
+
assertEquals
(
3
,
sorted
.
get
(
"
c
"
)
)
+
assertEquals
(
arrayList
(
"
a
"
,
"
b
"
,
"
c
"
)
,
sorted
.
keySet
(
)
!
!
.
toList
(
)
)
+
+ + fun <K, V> Map<K, V>.toSortedMap(comparator: Comparator<K>): SortedMap<K, V>+
Converts this Map to a SortedMap using the given comparator so that iteration order will be in the order
defined by the comparator
val
map
=
hashMap
(
#
(
"
c
"
,
3
)
,
#
(
"
bc
"
,
2
)
,
#
(
"
bd
"
,
4
)
,
#
(
"
abc
"
,
1
)
)
+
val
c
=
comparator
<
String
>
{
a
,
b
->
+
val
answer
=
a
.
length
(
)
-
b
.
length
(
)
+
if
(
answer
==
0
)
a
.
compareTo
(
b
)
else
answer
+
}
+
val
sorted
=
map
.
toSortedMap
(
c
)
+
assertEquals
(
arrayList
(
"
c
"
,
"
bc
"
,
"
bd
"
,
"
abc
"
)
,
sorted
.
keySet
(
)
!
!
.
toList
(
)
)
+
assertEquals
(
1
,
sorted
.
get
(
"
abc
"
)
)
+
assertEquals
(
2
,
sorted
.
get
(
"
bc
"
)
)
+
assertEquals
(
3
,
sorted
.
get
(
"
c
"
)
)
+
-fun <T, C>
Iterable<T>
to(result: C): C
+toArray(): Array<T>
-fun <T>
Collection<T>
toArray(): Array<T>
+toCollection(): Collection<T>
-fun <T>
Iterable<T>
toCollection(): Collection<T>
+toCollection(result: C): C
Transforms each element of this collection with the given transform function and
adds each return value to the given results collection
@@ -1351,16 +1351,7 @@
Returns a list containing the first elements that satisfy the given predicate
- - fun <T, C> Iterable<T>.to(result: C): C-
Copies all elements into the given collection
-+ + fun <T, C> Iterable<T>.toCollection(result: C): C+
Copies all elements into the given collection
+@@ -1414,7 +1414,7 @@
TODO these functions don’t work when they generate the Array
versions when they are in JLIterables
diff --git a/versions/snapshot/apidocs/kotlin/jdbc/java/sql/Connection-extensions.html b/versions/snapshot/apidocs/kotlin/jdbc/java/sql/Connection-extensions.html index d049356e6e0cc..b8add6e09de61 100644 --- a/versions/snapshot/apidocs/kotlin/jdbc/java/sql/Connection-extensions.html +++ b/versions/snapshot/apidocs/kotlin/jdbc/java/sql/Connection-extensions.html @@ -2,7 +2,7 @@ - +java.sql.Connection Extensions fom kotlin.jdbc (Kotlin API (0.1-SNAPSHOT)) diff --git a/versions/snapshot/apidocs/kotlin/jdbc/java/sql/PreparedStatement-extensions.html b/versions/snapshot/apidocs/kotlin/jdbc/java/sql/PreparedStatement-extensions.html index c48dc9a098dc9..060e157dbc54e 100644 --- a/versions/snapshot/apidocs/kotlin/jdbc/java/sql/PreparedStatement-extensions.html +++ b/versions/snapshot/apidocs/kotlin/jdbc/java/sql/PreparedStatement-extensions.html @@ -2,7 +2,7 @@ - + java.sql.PreparedStatement Extensions fom kotlin.jdbc (Kotlin API (0.1-SNAPSHOT)) diff --git a/versions/snapshot/apidocs/kotlin/jdbc/java/sql/ResultSet-extensions.html b/versions/snapshot/apidocs/kotlin/jdbc/java/sql/ResultSet-extensions.html index 0fc7738399e71..0eff7e877e57e 100644 --- a/versions/snapshot/apidocs/kotlin/jdbc/java/sql/ResultSet-extensions.html +++ b/versions/snapshot/apidocs/kotlin/jdbc/java/sql/ResultSet-extensions.html @@ -2,7 +2,7 @@ - + java.sql.ResultSet Extensions fom kotlin.jdbc (Kotlin API (0.1-SNAPSHOT)) diff --git a/versions/snapshot/apidocs/kotlin/jdbc/javax/sql/DataSource-extensions.html b/versions/snapshot/apidocs/kotlin/jdbc/javax/sql/DataSource-extensions.html index fad6ed3206629..391f3ffed465c 100644 --- a/versions/snapshot/apidocs/kotlin/jdbc/javax/sql/DataSource-extensions.html +++ b/versions/snapshot/apidocs/kotlin/jdbc/javax/sql/DataSource-extensions.html @@ -2,7 +2,7 @@ - + javax.sql.DataSource Extensions fom kotlin.jdbc (Kotlin API (0.1-SNAPSHOT)) diff --git a/versions/snapshot/apidocs/kotlin/jdbc/package-frame.html b/versions/snapshot/apidocs/kotlin/jdbc/package-frame.html index 75c27141dd3d7..7788c3fd80aa4 100644 --- a/versions/snapshot/apidocs/kotlin/jdbc/package-frame.html +++ b/versions/snapshot/apidocs/kotlin/jdbc/package-frame.html @@ -2,7 +2,7 @@ - + kotlin.jdbc (Kotlin API (0.1-SNAPSHOT)) diff --git a/versions/snapshot/apidocs/kotlin/jdbc/package-summary.html b/versions/snapshot/apidocs/kotlin/jdbc/package-summary.html index 347ef3ec13ec4..25598f4c7cb38 100644 --- a/versions/snapshot/apidocs/kotlin/jdbc/package-summary.html +++ b/versions/snapshot/apidocs/kotlin/jdbc/package-summary.html @@ -2,7 +2,7 @@ - + kotlin.jdbc (Kotlin API (0.1-SNAPSHOT)) diff --git a/versions/snapshot/apidocs/kotlin/jet/Array-extensions.html b/versions/snapshot/apidocs/kotlin/jet/Array-extensions.html index 370ba41689e3c..60468f064f78c 100644 --- a/versions/snapshot/apidocs/kotlin/jet/Array-extensions.html +++ b/versions/snapshot/apidocs/kotlin/jet/Array-extensions.html @@ -2,7 +2,7 @@ - + jet.Array Extensions fom kotlin (Kotlin API (0.1-SNAPSHOT)) @@ -499,7 +499,7 @@
map(transform: (T) -> R): List<R>
-Returns a new List containing the results of applying the given function to each element in this collection +Returns a new List containing the results of applying the given transform function to each element in this collection
mapTo(result: C, transform: (T) -> R): C
-fun <T, C>
Array<T>
to(result: C): C
+toCollection(): Collection<T>
-fun <T>
Array<T>
toCollection(): Collection<T>
+toCollection(result: C): C
fun <T, R> Array<T>.map(transform: (T) -> R): List<R>-
Returns a new List containing the results of applying the given function to each element in this collection
+Returns a new List containing the results of applying the given transform function to each element in this collection
val
data
=
arrayList
(
"
foo
"
,
"
bar
"
)
val
lengths
=
data
.
map
<
String
,
Int
>
{
it
.
length
}
assertTrue
{
@@ -1161,13 +1161,13 @@
fun <T, R, C> Array<T>.mapTo(result: C, transform: (T) -> R): C-
Transforms each element of this collection with the given function then adds the results to the given collection
+Transforms each element of this collection with the given transform function and
adds each return value to the given results collection
Returns a list containing the first elements that satisfy the given predicate
- - fun <T, C> Array<T>.to(result: C): C-
Copies all elements into the given collection
-+ + fun <T, C> Array<T>.toCollection(result: C): C+
Copies all elements into the given collection
+map(transform: (T) -> R): List<R>
mapTo(result: C, transform: (T) -> R): C
-fun <T, C>
Iterable<T>
to(result: C): C
+toCollection(): Collection<T>
-fun <T>
Iterable<T>
toCollection(): Collection<T>
+toCollection(result: C): C
fun <T, R> Iterable<T>.map(transform: (T) -> R): List<R>-
Returns a new List containing the results of applying the given function to each element in this collection
+Returns a new List containing the results of applying the given transform function to each element in this collection
val
data
=
arrayList
(
"
foo
"
,
"
bar
"
)
val
lengths
=
data
.
map
<
String
,
Int
>
{
it
.
length
}
assertTrue
{
@@ -1029,13 +1029,13 @@
fun <T, R, C> Iterable<T>.mapTo(result: C, transform: (T) -> R): C-
Transforms each element of this collection with the given function then adds the results to the given collection
+Transforms each element of this collection with the given transform function and
adds each return value to the given results collection
Returns a list containing the first elements that satisfy the given predicate
- - fun <T, C> Iterable<T>.to(result: C): C-
Copies all elements into the given collection
-+ + fun <T, C> Iterable<T>.toCollection(result: C): C+
Copies all elements into the given collection
+
+
+
+
+fun <T>
Iterator<T>
+
+
+
toArrayList(): ArrayList<T>
+
+
@@ -144,7 +160,7 @@
to(container: U): U
+toCollection(container: U): U
toArrayList(): ArrayList<T>
+toHashSet(): HashSet<T>
toHashSet(): HashSet<T>
+toLinkedList(): LinkedList<T>
toLinkedHashSet(): LinkedHashSet<T>
+toLinkedSet(): LinkedHashSet<T>
toLinkedList(): LinkedList<T>
+toSortedSet(): SortedSet<T>
toTreeSet(): TreeSet<T>
+toSortedSet(comparator: Comparator<T>): SortedSet<T>
- - fun <T, U> Iterator<T>.to(container: U): U-
Add iterated elements to given container
-- fun <T> Iterator<T>.toHashSet(): HashSet<T>-
Add iterated elements to java.util.HashSet
+ fun <T, U> Iterator<T>.toCollection(container: U): U +Add iterated elements to given container
- fun <T> Iterator<T>.toLinkedHashSet(): LinkedHashSet<T>-
Add iterated elements to java.util.LinkedHashSet
+ fun <T> Iterator<T>.toHashSet(): HashSet<T> +Add iterated elements to java.util.HashSet
+ + fun <T> Iterator<T>.toLinkedSet(): LinkedHashSet<T>+
Add iterated elements to a LinkedHashSet to preserve insertion order
++ + fun <T> Iterator<T>.toSortedSet(): SortedSet<T>+
Add iterated elements to SortedSet to ensure iteration is in the order of the default comparator
for the type
- fun <T> Iterator<T>.toTreeSet(): TreeSet<T>-
Add iterated elements to java.util.TreeSet
+ fun <T> Iterator<T>.toSortedSet(comparator: Comparator<T>): SortedSet<T> +Add iterated elements to SortedSet with the given comparator to ensure iteration is in the order of the given comparator
to(result: C): C
+toCollection(result: C): C
- fun <T, C> T?.to(result: C): C+ fun <T, C> T?.toCollection(result: C): C
Copies the collection into the given collection
comparator(vararg functions: (T) -> Any): Comparator<T>
+
+
+
+
+fun <T>
+
+
+
comparator(fn: (T, T) -> Int): Comparator<T>
+
sortedSet(comparator: Comparator<T>, vararg values: T): TreeSet<T>
+
+
+
+
+
+fun <T>
+
+
+
sortedSet(vararg values: T): TreeSet<T>
+
+
+
+fun <A, B>
A
+
+
+
to(that: B): #(A, B)
+
+Creates a comparator using the sequence of functions used to calculate a value to compare on
+ + fun <T> comparator(fn: (T, T) -> Int): Comparator<T>+
Creates a comparator using the sequence of functions used to calculate a value to compare on
+@@ -1400,13 +1453,19 @@Contents
Returns a new LinkedList with a variable number of initial elements
fun <K, V> linkedMap(vararg values: #(K, V)): LinkedHashMap<K, V>-
Returns a new LinkedHashMap populated with the given tuple values where the first value in each tuple
is the key and the second value is the value. This map preserves insertion order so iterating through
the map’s entries will be in the same order
@includeFunctionBody ../../test/MapTest.kt createLinkedHashMap
+Returns a new LinkedHashMap populated with the given tuple values where the first value in each tuple
is the key and the second value is the value. This map preserves insertion order so iterating through
the map’s entries will be in the same order
val
map
=
linkedMap
(
#
(
"
c
"
,
3
)
,
#
(
"
b
"
,
2
)
,
#
(
"
a
"
,
1
)
)
+
assertEquals
(
1
,
map
.
get
(
"
a
"
)
)
+
assertEquals
(
2
,
map
.
get
(
"
b
"
)
)
+
assertEquals
(
3
,
map
.
get
(
"
c
"
)
)
+
assertEquals
(
arrayList
(
"
c
"
,
"
b
"
,
"
a
"
)
,
map
.
keySet
(
)
.
toList
(
)
)
+
Throws an IllegalArgumentException with specified message
if the value
is false.
@@ -1480,7 +1539,6 @@Contents
fun <K, V> sortedMap(vararg values: #(K, V)): SortedMap<K, V>
Returns a new SortedMap populated with the given tuple values where the first value in each tuple
is the key and the second value is the value
val
map
=
sortedMap
(
#
(
"
c
"
,
3
)
,
#
(
"
b
"
,
2
)
,
#
(
"
a
"
,
1
)
)
-
assertEquals
(
3
,
map
.
size
)
assertEquals
(
1
,
map
.
get
(
"
a
"
)
)
assertEquals
(
2
,
map
.
get
(
"
b
"
)
)
assertEquals
(
3
,
map
.
get
(
"
c
"
)
)
@@ -1488,13 +1546,36 @@ Contents
+ + fun <T> sortedSet(comparator: Comparator<T>, vararg values: T): TreeSet<T>+
Returns a new SortedSet with the given comparator and the initial elements
+fun <T> sortedSet(vararg values: T): TreeSet<T>-
Returns a new SortedSet with a variable number of initial elements
+Returns a new SortedSet with the initial elements
++ + fun <A, B> A.to(that: B): #(A, B)+
Creates a tuple of type #(A,B) from this and that which can be useful for creating Map literals
with less noise, for example
val
map
=
hashMap
(
"
a
"
to
1
,
"
b
"
to
2
)
+
assertEquals
(
2
,
map
.
size
)
+
assertEquals
(
1
,
map
.
get
(
"
a
"
)
)
+
assertEquals
(
2
,
map
.
get
(
"
b
"
)
)
+