StdLib cleanup: deprecated usages

This commit is contained in:
Ilya Gorbunov
2015-09-29 21:44:18 +03:00
parent 70d064052b
commit ff69b97030
7 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -165,10 +165,10 @@ public val NodeList.outerHTML: String
get() = toList().map { it.innerHTML }.join("")
/** Returns an [Iterator] of all the next [Element] siblings */
public fun Node.nextElements(): List<Element> = nextSiblings().filterIsInstance(javaClass<Element>())
public fun Node.nextElements(): List<Element> = nextSiblings().filterIsInstance<Element>()
/** Returns an [Iterator] of all the previous [Element] siblings */
public fun Node.previousElements(): List<Element> = previousSiblings().filterIsInstance(javaClass<Element>())
public fun Node.previousElements(): List<Element> = previousSiblings().filterIsInstance<Element>()
public var Element.classSet: MutableSet<String>
@@ -49,7 +49,7 @@ public fun createTempFile(prefix: String = "tmp", suffix: String? = null, direct
* Returns this if this file is a directory, or the parent if it is a file inside a directory.
*/
public val File.directory: File
get() = if (isDirectory()) this else parent!!
get() = if (isDirectory()) this else parentFile!!
/**
* Returns parent of this abstract path name, or `null` if it has no parent.
@@ -158,7 +158,7 @@ public enum class CharCategory(public val value: Int, public val code: String) {
public companion object {
private val categoryMap by Delegates.lazy { CharCategory.values().toMap { it.value } }
private val categoryMap by lazy { CharCategory.values().toMap { it.value } }
public fun valueOf(category: Int): CharCategory = categoryMap[category] ?: throw IllegalArgumentException("Category #$category is not defined.")
}
@@ -112,7 +112,7 @@ public enum class CharDirectionality(public val value: Int) {
public companion object {
private val directionalityMap by Delegates.lazy { CharDirectionality.values().toMap { it.value } }
private val directionalityMap by lazy { CharDirectionality.values().toMap { it.value } }
public fun valueOf(directionality: Int): CharDirectionality = directionalityMap[directionality] ?: throw IllegalArgumentException("Directionality #$directionality is not defined.")
}