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

dregex.impl.states.scala Maven / Gradle / Ivy

The newest version!
package dregex.impl

import java.util.concurrent.atomic.AtomicInteger

trait State

class SimpleState extends State {
  val id = SimpleState.counter.getAndIncrement()
  override def toString() = s"s${Util.toSubscriptString(id)}"
}

object SimpleState {
  private val counter = new AtomicInteger
}

case class BiState[A <: State](first: A, second: A) extends State {
  override def toString() = {
    s"$first,$second"
  }
}

case class MultiState(states: Set[State]) extends State {
  override def toString() = {
    states.mkString(",")
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy