This traits provides the same interface as Ordered as well as the modular
ordering functions. As with that trait it works by extending the companion
object of the enumeration class.
@enum class Color {
Red
Blue
Yellow
}
object Color extends OrderedModular[Color]
This enables the following functions.
Red.prevMod
Color.prevMod(Red) // Yellow
Yellow.nextMod
Color.nextMod(Yellow) // Red
This traits provides the same interface as
Ordered
as well as the modular ordering functions. As with that trait it works by extending the companion object of the enumeration class.This enables the following functions.