sizeCompare 方法(或属性)属于 scala.collection.AbstractIterable 类(class),其相关用法说明如下。
用法 一
def sizeCompare(that: Iterable[_]): Int
将此可迭代集合的大小与另一个 Iterable 的大小进行比较.
值参数:
- that
 Iterable的大小与此可迭代集合的大小进行比较.
返回:
一个值
x其中x < 0 if this.size < that.size x == 0 if this.size == that.size x > 0 if this.size > that.size这里实现的方法不直接调用
size;它的运行时间是O(this.size min that.size)而不是O(this.size + that.size)。如果计算size很便宜并且knownSize返回-1,则应该重写该方法。继承自:
- IterableOps
 源码:
- Iterable.scala
 
用法 二
def sizeCompare(otherSize: Int): Int
将此可迭代集合的大小与测试值进行比较。
值参数:
- otherSize
 与大小进行比较的测试值。
返回:
一个值
x其中x < 0 if this.size < otherSize x == 0 if this.size == otherSize x > 0 if this.size > otherSize这里实现的方法不直接调用
size;它的运行时间是O(size min otherSize)而不是O(size)。如果计算size很便宜并且knownSize返回-1,则应该重写该方法。也可以看看:
继承自:
- collection.IterableOps.sizeCompare
 源码:
- Iterable.scala
 
相关用法
- Scala AbstractIterable.sizeIs用法及代码示例
 - Scala AbstractIterable.sliding用法及代码示例
 - Scala AbstractIterable.scanRight用法及代码示例
 - Scala AbstractIterable.partitionMap用法及代码示例
 - Scala AbstractIterable.inits用法及代码示例
 - Scala AbstractIterable.groupMap用法及代码示例
 - Scala AbstractIterable.mkString用法及代码示例
 - Scala AbstractIterable.groupMapReduce用法及代码示例
 - Scala AbstractIterable.unzip用法及代码示例
 - Scala AbstractIterable.collectFirst用法及代码示例
 - Scala AbstractIterable.transpose用法及代码示例
 - Scala AbstractIterable.lazyZip用法及代码示例
 - Scala AbstractIterable.groupBy用法及代码示例
 - Scala AbstractIterable.addString用法及代码示例
 - Scala AbstractIterable.unzip3用法及代码示例
 - Scala AbstractIterable.tails用法及代码示例
 - Scala AbstractIterator.sliding用法及代码示例
 - Scala AbstractIterator.mkString用法及代码示例
 - Scala AbstractIterator.collectFirst用法及代码示例
 - Scala AbstractIterator.grouped用法及代码示例
 - Scala AbstractIterator.addString用法及代码示例
 - Scala AbstractIndexedSeqView.collectFirst用法及代码示例
 - Scala AbstractIndexedSeqView.partitionMap用法及代码示例
 - Scala AbstractIndexedSeqView.sliding用法及代码示例
 - Scala AbstractIndexedSeqView.addString用法及代码示例
 
注:本文由纯净天空筛选整理自scala-lang.org大神的英文原创作品 AbstractIterable.sizeCompare。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
