All Downloads are FREE. Search and download functionalities are using the official Maven repository.

izumi.fundamentals.graphs.tools.random.Generator.scala Maven / Gradle / Ivy

package izumi.fundamentals.graphs.tools.random

import java.util.concurrent.atomic.AtomicInteger

trait Generator[N] {
  def make(): N
}

object Generator {

  implicit object IntGenerator extends Generator[Int] {
    private val last = new AtomicInteger(0)

    override def make(): Int = {
      last.getAndIncrement()
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy