Don't use "jet" prefix in stdlib sources
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package kotlin.jdbc
|
package kotlin.jdbc
|
||||||
|
|
||||||
import java.sql.*
|
import java.sql.*
|
||||||
import java.util.ArrayList
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes the specfied block with result set and then closes it
|
* Executes the specfied block with result set and then closes it
|
||||||
@@ -29,7 +28,7 @@ fun ResultSet.iterator() : Iterator<ResultSet> {
|
|||||||
/**
|
/**
|
||||||
* Returns iterable that calls to the specified mapper function for each row
|
* Returns iterable that calls to the specified mapper function for each row
|
||||||
*/
|
*/
|
||||||
fun <T> ResultSet.map(fn : (ResultSet) -> T) : jet.Iterable<T> {
|
fun <T> ResultSet.map(fn : (ResultSet) -> T) : Iterable<T> {
|
||||||
val rs = this
|
val rs = this
|
||||||
|
|
||||||
val iterator = object : Iterator<T>{
|
val iterator = object : Iterator<T>{
|
||||||
@@ -38,7 +37,7 @@ fun <T> ResultSet.map(fn : (ResultSet) -> T) : jet.Iterable<T> {
|
|||||||
public override fun next() : T = fn(rs)
|
public override fun next() : T = fn(rs)
|
||||||
}
|
}
|
||||||
|
|
||||||
return object : jet.Iterable<T> {
|
return object : Iterable<T> {
|
||||||
public override fun iterator(): Iterator<T> = iterator
|
public override fun iterator(): Iterator<T> = iterator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,17 +45,17 @@ fun <T> ResultSet.map(fn : (ResultSet) -> T) : jet.Iterable<T> {
|
|||||||
/**
|
/**
|
||||||
* Returns array with column names
|
* Returns array with column names
|
||||||
*/
|
*/
|
||||||
fun ResultSet.getColumnNames() : jet.Array<String> {
|
fun ResultSet.getColumnNames() : Array<String> {
|
||||||
val meta = getMetaData()
|
val meta = getMetaData()
|
||||||
return jet.Array<String>(meta.getColumnCount(), {meta.getColumnName(it + 1) ?: it.toString()})
|
return Array<String>(meta.getColumnCount(), {meta.getColumnName(it + 1) ?: it.toString()})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array filled with values from current row in the cursor. Values will have the same order as column's order
|
* Return array filled with values from current row in the cursor. Values will have the same order as column's order
|
||||||
* @columnNames you can specify column names to extract otherwise all columns will be extracted
|
* @columnNames you can specify column names to extract otherwise all columns will be extracted
|
||||||
*/
|
*/
|
||||||
fun ResultSet.getValues(columnNames : jet.Array<String> = getColumnNames()) : jet.Array<Any?> {
|
fun ResultSet.getValues(columnNames : Array<String> = getColumnNames()) : Array<Any?> {
|
||||||
return jet.Array<Any?>(columnNames.size, {
|
return Array<Any?>(columnNames.size, {
|
||||||
this[columnNames[it]]
|
this[columnNames[it]]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -65,7 +64,7 @@ fun ResultSet.getValues(columnNames : jet.Array<String> = getColumnNames()) : je
|
|||||||
* Return map filled with values from current row in the cursor. Uses column names as keys for result map.
|
* Return map filled with values from current row in the cursor. Uses column names as keys for result map.
|
||||||
* @param columnNames you can specify column names to extract otherwise all columns will be extracted
|
* @param columnNames you can specify column names to extract otherwise all columns will be extracted
|
||||||
*/
|
*/
|
||||||
fun ResultSet.getValuesAsMap(columnNames : jet.Array<String> = getColumnNames()) : Map<String, Any?> {
|
fun ResultSet.getValuesAsMap(columnNames : Array<String> = getColumnNames()) : Map<String, Any?> {
|
||||||
val result = java.util.HashMap<String, Any?>(columnNames.size)
|
val result = java.util.HashMap<String, Any?>(columnNames.size)
|
||||||
|
|
||||||
columnNames.forEach {
|
columnNames.forEach {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public fun String?.isNotEmpty() : Boolean = this != null && this.length() > 0
|
|||||||
/**
|
/**
|
||||||
Iterator for characters of given CharSequence
|
Iterator for characters of given CharSequence
|
||||||
*/
|
*/
|
||||||
public fun CharSequence.iterator() : CharIterator = object: jet.CharIterator() {
|
public fun CharSequence.iterator() : CharIterator = object : CharIterator() {
|
||||||
private var index = 0
|
private var index = 0
|
||||||
|
|
||||||
public override fun nextChar(): Char = get(index++)
|
public override fun nextChar(): Char = get(index++)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ private class NotNullVar<T: Any>() : ReadWriteProperty<Any?, T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ObservableProperty<T>(initialValue: T, val onChange: (name: jet.PropertyMetadata, oldValue: T, newValue: T) -> Boolean): ReadWriteProperty<Any?, T> {
|
class ObservableProperty<T>(initialValue: T, val onChange: (name: PropertyMetadata, oldValue: T, newValue: T) -> Boolean): ReadWriteProperty<Any?, T> {
|
||||||
private var value = initialValue
|
private var value = initialValue
|
||||||
|
|
||||||
public override fun get(thisRef: Any?, desc: PropertyMetadata): T {
|
public override fun get(thisRef: Any?, desc: PropertyMetadata): T {
|
||||||
|
|||||||
Reference in New Issue
Block a user