transpose 方法(或属性)属于 scala.collection.AbstractIndexedSeqView 类(class),其相关用法说明如下。
用法:
def transpose[B](implicit asIterable: A => Iterable[B]): View[View[B]]
将此可迭代集合的可迭代集合转置为可迭代集合的可迭代集合。
结果集合的类型将由可迭代集合的静态类型引导。例如:
val xs = List(
           Set(1, 2, 3),
           Set(4, 5, 6)).transpose
// xs == List(
//         List(1, 4),
//         List(2, 5),
//         List(3, 6))
val ys = Vector(
           List(1, 2, 3),
           List(4, 5, 6)).transpose
// ys == Vector(
//         Vector(1, 4),
//         Vector(2, 5),
//         Vector(3, 6))
注意:即使应用于视图或惰性集合,它也会始终强制元素。
类型参数:
- B
 每个可迭代集合的元素类型。
值参数:
- asIterable
 断言此可迭代集合的元素类型是
Iterable的隐式转换.
返回:
可迭代集合的二维可迭代集合,具有 asn扔n此可迭代集合的第 th 列.
抛出:
- IllegalArgumentException
 如果此可迭代集合中的所有集合的大小不同。
继承自:
- collection.IterableOps.transpose
 源码:
- Iterable.scala
 
相关用法
- Scala AbstractIndexedSeqView.tails用法及代码示例
 - Scala AbstractIndexedSeqView.collectFirst用法及代码示例
 - Scala AbstractIndexedSeqView.partitionMap用法及代码示例
 - Scala AbstractIndexedSeqView.sliding用法及代码示例
 - Scala AbstractIndexedSeqView.addString用法及代码示例
 - Scala AbstractIndexedSeqView.unzip用法及代码示例
 - Scala AbstractIndexedSeqView.mkString用法及代码示例
 - Scala AbstractIndexedSeqView.sortBy用法及代码示例
 - Scala AbstractIndexedSeqView.sizeIs用法及代码示例
 - Scala AbstractIndexedSeqView.groupBy用法及代码示例
 - Scala AbstractIndexedSeqView.lengthIs用法及代码示例
 - Scala AbstractIndexedSeqView.combinations用法及代码示例
 - Scala AbstractIndexedSeqView.inits用法及代码示例
 - Scala AbstractIndexedSeqView.lazyZip用法及代码示例
 - Scala AbstractIndexedSeqView.unzip3用法及代码示例
 - Scala AbstractIndexedSeqView.sortWith用法及代码示例
 - Scala AbstractIndexedSeqView.permutations用法及代码示例
 - Scala AbstractIndexedSeqView.scanRight用法及代码示例
 - Scala AbstractIndexedSeqView.groupMapReduce用法及代码示例
 - Scala AbstractIndexedSeqView.groupMap用法及代码示例
 - Scala AbstractIterator.sliding用法及代码示例
 - Scala AbstractIterable.partitionMap用法及代码示例
 - Scala AbstractIterable.inits用法及代码示例
 - Scala AbstractIterable.groupMap用法及代码示例
 - Scala AbstractIterable.sizeIs用法及代码示例
 
注:本文由纯净天空筛选整理自scala-lang.org大神的英文原创作品 AbstractIndexedSeqView.transpose。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
