Rename parameters: ClosedRange.contains

This commit is contained in:
Ilya Gorbunov
2015-11-20 19:40:56 +03:00
parent 9c59045f48
commit 7c726bcaf9
3 changed files with 11 additions and 11 deletions
+5 -5
View File
@@ -33,9 +33,9 @@ public interface Range<T : Comparable<T>> {
public val end: T
/**
* Checks if the specified value belongs to the range.
* Checks if the specified [value] belongs to the range.
*/
public operator fun contains(item: T): Boolean
public operator fun contains(value: T): Boolean
/**
* Checks if the range is empty.
@@ -65,12 +65,12 @@ public interface ClosedRange<T: Comparable<T>> : Range<T> {
public val endInclusive: T
/**
* Checks if the specified value belongs to the range.
* Checks whether the specified [value] belongs to the range.
*/
public override operator fun contains(item: T): Boolean = item >= start && item <= endInclusive
public override operator fun contains(value: T): Boolean = value >= start && value <= endInclusive
/**
* Checks if the range is empty.
* Checks whether the range is empty.
*/
public override fun isEmpty(): Boolean = start > endInclusive
}
+5 -5
View File
@@ -29,7 +29,7 @@ public class ByteRange(start: Byte, endInclusive: Byte) : ByteProgression(start,
override val start: Byte get() = first
override val endInclusive: Byte get() = last
override fun contains(item: Byte): Boolean = start <= item && item <= endInclusive
override fun contains(value: Byte): Boolean = start <= value && value <= endInclusive
override fun isEmpty(): Boolean = start > endInclusive
@@ -58,7 +58,7 @@ public class CharRange(start: Char, endInclusive: Char) : CharProgression(start,
override val start: Char get() = first
override val endInclusive: Char get() = last
override fun contains(item: Char): Boolean = start <= item && item <= endInclusive
override fun contains(value: Char): Boolean = start <= value && value <= endInclusive
override fun isEmpty(): Boolean = start > endInclusive
@@ -88,7 +88,7 @@ public class ShortRange(start: Short, endInclusive: Short) : ShortProgression(st
override val start: Short get() = first
override val endInclusive: Short get() = last
override fun contains(item: Short): Boolean = start <= item && item <= endInclusive
override fun contains(value: Short): Boolean = start <= value && value <= endInclusive
override fun isEmpty(): Boolean = start > endInclusive
@@ -117,7 +117,7 @@ public class IntRange(start: Int, endInclusive: Int) : IntProgression(start, end
override val start: Int get() = first
override val endInclusive: Int get() = last
override fun contains(item: Int): Boolean = start <= item && item <= endInclusive
override fun contains(value: Int): Boolean = start <= value && value <= endInclusive
override fun isEmpty(): Boolean = start > endInclusive
@@ -146,7 +146,7 @@ public class LongRange(start: Long, endInclusive: Long) : LongProgression(start,
override val start: Long get() = first
override val endInclusive: Long get() = last
override fun contains(item: Long): Boolean = start <= item && item <= endInclusive
override fun contains(value: Long): Boolean = start <= value && value <= endInclusive
override fun isEmpty(): Boolean = start > endInclusive
@@ -83,7 +83,7 @@ public class $range(start: $t, endInclusive: $t) : ${t}Progression(start, endInc
override val endInclusive: $t get() = last
""" else "") +
"""
override fun contains(item: $t): Boolean = start <= item && item <= endInclusive
override fun contains(value: $t): Boolean = start <= value && value <= endInclusive
override fun isEmpty(): Boolean = start > endInclusive