本文整理汇总了Scala中scala.collection.generic.Growable类的典型用法代码示例。如果您正苦于以下问题:Scala Growable类的具体用法?Scala Growable怎么用?Scala Growable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Growable类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Scala代码示例。
示例1: put
//设置package包名称以及导入依赖的类
package scala
package collection.parallel
package mutable
import scala.collection.generic._
import scala.collection.mutable.Cloneable
import scala.collection.generic.Growable
import scala.collection.generic.Shrinkable
trait ParMapLike[K,
V,
+Repr <: ParMapLike[K, V, Repr, Sequential] with ParMap[K, V],
+Sequential <: scala.collection.mutable.Map[K, V] with scala.collection.mutable.MapLike[K, V, Sequential]]
extends scala.collection.GenMapLike[K, V, Repr]
with scala.collection.parallel.ParMapLike[K, V, Repr, Sequential]
with Growable[(K, V)]
with Shrinkable[K]
with Cloneable[Repr]
{
// note: should not override toMap
def put(key: K, value: V): Option[V]
def +=(kv: (K, V)): this.type
def -=(key: K): this.type
def +[U >: V](kv: (K, U)) = this.clone().asInstanceOf[ParMap[K, U]] += kv
def -(key: K) = this.clone() -= key
def clear(): Unit
}
开发者ID:scala,项目名称:scala-parallel-collections,代码行数:35,代码来源:ParMapLike.scala
示例2: empty
//设置package包名称以及导入依赖的类
package scala
package collection
package parallel.mutable
import scala.collection.mutable.Cloneable
import scala.collection.GenSetLike
import scala.collection.generic.Growable
import scala.collection.generic.Shrinkable
trait ParSetLike[T,
+Repr <: ParSetLike[T, Repr, Sequential] with ParSet[T],
+Sequential <: mutable.Set[T] with mutable.SetLike[T, Sequential]]
extends GenSetLike[T, Repr]
with scala.collection.parallel.ParIterableLike[T, Repr, Sequential]
with scala.collection.parallel.ParSetLike[T, Repr, Sequential]
with Growable[T]
with Shrinkable[T]
with Cloneable[Repr]
{
self =>
override def empty: Repr
def +=(elem: T): this.type
def -=(elem: T): this.type
def +(elem: T) = this.clone() += elem
def -(elem: T) = this.clone() -= elem
// note: should not override toSet
}
开发者ID:scala,项目名称:scala-parallel-collections,代码行数:34,代码来源:ParSetLike.scala
注:本文中的scala.collection.generic.Growable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论