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

spice.delta.StreamAction.scala Maven / Gradle / Ivy

There is a newer version: 0.6.1
Show newest version
package spice.delta

sealed trait StreamAction {
  def position: Int
  def priority: Int
}

object StreamAction {
  case class Insert(position: Int, content: String, priority: Int) extends StreamAction

  case class Skip(position: Int, end: Int, priority: Int) extends StreamAction

  case class Reposition(position: Int, priority: Int) extends StreamAction

  case class Group(actions: List[StreamAction], priority: Int) extends StreamAction {
    lazy val position: Int = actions.foldLeft(Int.MaxValue)((min, action) => math.min(min, action.position))
  }

  case class Process(position: Int, end: Int, processor: String => String, priority: Int) extends StreamAction
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy