本文整理汇总了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
}
示例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
}