File: bug602.scala

package info (click to toggle)
scala 2.9.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 67,252 kB
  • ctags: 6,602
  • sloc: java: 27,488; xml: 4,412; python: 2,297; sh: 734; makefile: 16; ansic: 6
file content (14 lines) | stat: -rw-r--r-- 524 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package com.mosol.sl

case class Span[K <: Ordered[K]](low: Option[K], high: Option[K]) extends Function1[K, Boolean] {
  override def equals(x$1: Any): Boolean = x$1 match {
    case Span((low$0 @ _), (high$0 @ _)) if low$0.equals(low).$amp$amp(high$0.equals(high)) => true
    case _ => false
  }
  def apply(k: K): Boolean = this match {
    case Span(Some(low), Some(high)) => (k >= low && k <= high)
    case Span(Some(low), None) => (k >= low)
    case Span(None, Some(high)) => (k <= high)
    case _ => false
  } 
}