Skip to content

Instantly share code, notes, and snippets.

@oluies
Created August 9, 2017 20:18
Show Gist options
  • Save oluies/458bb7696259c1df853ee5e26c572b93 to your computer and use it in GitHub Desktop.
Save oluies/458bb7696259c1df853ee5e26c572b93 to your computer and use it in GitHub Desktop.
case class Station(STN: Option[Int], WBAN: Option[Int], GPSLocation: Location)
case class TemperatureReading(stn: String,
wban: String,
month: Int,
day: Int,
temperature: Double)
case class Location(lat: Double, lon: Double){
private def isZero(value: Double, threshold: Double): Boolean = value >= -threshold && value <= threshold
private val threshold = 0.1d
def isLocationZero(): Boolean ={
isZero(lat,0.1) || isZero(lon,0.1)
}
}
case class Color(red: Int, green: Int, blue: Int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment