replace 'trait' keyword with 'interface' in library code
This commit is contained in:
@@ -4,7 +4,7 @@ import java.util.Enumeration
|
||||
import java.util.NoSuchElementException
|
||||
|
||||
deprecated("Use Sequence<T> instead.")
|
||||
public trait Stream<out T> {
|
||||
public interface Stream<out T> {
|
||||
/**
|
||||
* Returns an iterator that returns the values from the sequence.
|
||||
*/
|
||||
@@ -17,7 +17,7 @@ public trait Stream<out T> {
|
||||
*
|
||||
* @param T the type of elements in the sequence.
|
||||
*/
|
||||
public trait Sequence<out T> : Stream<T>
|
||||
public interface Sequence<out T> : Stream<T>
|
||||
|
||||
public fun<T> Stream<T>.toSequence(): Sequence<T> = object : Sequence<T> {
|
||||
override fun iterator(): Iterator<T> = this@toSequence.iterator()
|
||||
|
||||
@@ -126,7 +126,7 @@ public fun println() {
|
||||
|
||||
// Since System.in can change its value on the course of program running,
|
||||
// we should always delegate to current value and cannot just pass it to InputStreamReader constructor.
|
||||
// We could use "by" implementation, but we can only use "by" with traits and InputStream is abstract class.
|
||||
// We could use "by" implementation, but we can only use "by" with interfaces and InputStream is abstract class.
|
||||
private val stdin: BufferedReader = BufferedReader(InputStreamReader(object : InputStream() {
|
||||
public override fun read(): Int {
|
||||
return System.`in`.read()
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package kotlin.properties
|
||||
|
||||
/**
|
||||
* Base trait that can be used for implementing property delegates of read-only properties. This is provided only for
|
||||
* convenience; you don't have to extend this trait as long as your property delegate has methods with the same
|
||||
* Base interface that can be used for implementing property delegates of read-only properties. This is provided only for
|
||||
* convenience; you don't have to extend this interface as long as your property delegate has methods with the same
|
||||
* signatures.
|
||||
* @param R the type of object which owns the delegated property.
|
||||
* @param T the type of the property value.
|
||||
*/
|
||||
public trait ReadOnlyProperty<in R, out T> {
|
||||
public interface ReadOnlyProperty<in R, out T> {
|
||||
/**
|
||||
* Returns the value of the property for the given object.
|
||||
* @param thisRef the object for which the value is requested.
|
||||
@@ -18,13 +18,13 @@ public trait ReadOnlyProperty<in R, out T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Base trait that can be used for implementing property delegates of read-only properties. This is provided only for
|
||||
* convenience; you don't have to extend this trait as long as your property delegate has methods with the same
|
||||
* Base interface that can be used for implementing property delegates of read-only properties. This is provided only for
|
||||
* convenience; you don't have to extend this interface as long as your property delegate has methods with the same
|
||||
* signatures.
|
||||
* @param R the type of object which owns the delegated property.
|
||||
* @param T the type of the property value.
|
||||
*/
|
||||
public trait ReadWriteProperty<in R, T> {
|
||||
public interface ReadWriteProperty<in R, T> {
|
||||
/**
|
||||
* Returns the value of the property for the given object.
|
||||
* @param thisRef the object for which the value is requested.
|
||||
|
||||
@@ -14,7 +14,7 @@ public class ChangeEvent(
|
||||
}
|
||||
|
||||
deprecated("This class is part of an old, incomplete and suboptimal design of change notifications and is going to be removed")
|
||||
public trait ChangeListener {
|
||||
public interface ChangeListener {
|
||||
public fun onPropertyChange(event: ChangeEvent): Unit
|
||||
}
|
||||
|
||||
|
||||
@@ -86,8 +86,8 @@ public fun StringTemplate.toHtml(formatter: HtmlFormatter = HtmlFormatter()): St
|
||||
* how to format values for a particular [[Locale]] such as with the [[LocaleFormatter]] or
|
||||
* to escape particular characters in different output formats such as [[HtmlFormatter]
|
||||
*/
|
||||
deprecated("This trait is part of an experimental implementation of string templates and is going to be removed")
|
||||
public trait Formatter {
|
||||
deprecated("This interface is part of an experimental implementation of string templates and is going to be removed")
|
||||
public interface Formatter {
|
||||
public fun format(buffer: Appendable, value: Any?): Unit
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public fun fails(block: () -> Unit): Throwable? {
|
||||
* Abstracts the logic for performing assertions. Specific implementations of [Asserter] can use JUnit
|
||||
* or TestNG assertion facilities.
|
||||
*/
|
||||
public trait Asserter {
|
||||
public interface Asserter {
|
||||
/**
|
||||
* Asserts that the specified value is true.
|
||||
*
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package kotlin.text
|
||||
|
||||
/** Represents a collection of captured groups in a single match. */
|
||||
public trait MatchGroupCollection : Collection<MatchGroup?> {
|
||||
public interface MatchGroupCollection : Collection<MatchGroup?> {
|
||||
|
||||
/** Returns a group with the specified [index]
|
||||
*
|
||||
@@ -34,7 +34,7 @@ public trait MatchGroupCollection : Collection<MatchGroup?> {
|
||||
/**
|
||||
* Represents the results from a single regular expression match.
|
||||
*/
|
||||
public trait MatchResult {
|
||||
public interface MatchResult {
|
||||
/** The range of indices in the original string where match was captured. */
|
||||
public val range: IntRange
|
||||
/** The substring from the input string captured by this match. */
|
||||
|
||||
@@ -19,7 +19,7 @@ package kotlin.text
|
||||
import java.util.regex.Pattern
|
||||
import java.util.regex.Matcher
|
||||
|
||||
private trait FlagEnum {
|
||||
private interface FlagEnum {
|
||||
public val value: Int
|
||||
public val mask: Int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user