home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (RemoveDuplicates.scala)

This example Scala source code file (RemoveDuplicates.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

array, companion, companion, cont, havingresult, int, int, list, removeduplicates, removeduplicates, resettable, string, string

The Scala RemoveDuplicates.scala source code

package scala.collection.parallel.benchmarks
package parallel_array

class RemoveDuplicates(sz: Int, p: Int, what: String)
extends Resettable[Cont](sz, p, what, (i: Int) => new Cont(i),  new Array[Any](_), classOf[Cont])
with HavingResult[Int] {
  def companion = RemoveDuplicates
  override def repetitionsPerRun = 400
  def runpar = runresult = pa.distinct.size
  def runseq = runresult = sequentialRemoveDuplicates(size).size
  override def comparisonMap = collection.Map()

object RemoveDuplicates extends Companion {
  def benchName = "remove-duplicates";
  def apply(sz: Int, p: Int, what: String) = new RemoveDuplicates(sz, p, what)
  override def comparisons = List()
  override def defaultSize = 10000

Other Scala examples (source code examples)

Here is a short list of links related to this Scala RemoveDuplicates.scala source code file:

my book on functional programming


new blog posts


Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.