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

geotrellis.statistics.ConstantHistogram.scala Maven / Gradle / Ivy

The newest version!
package geotrellis.statistics

import geotrellis._

case class ConstantHistogram(value:Int,size:Int) extends Histogram {
  def copy = ConstantHistogram(value,size)

  def foreachValue(f:Int=>Unit) = f(value)
  def getItemCount(item:Int):Int = if(item == value) size else 0
  def getMaxValue():Int = value
  def getMinValue():Int = value
  def getTotalCount():Int = size
  def getValues():Array[Int] = Array(value)
  def rawValues():Array[Int] = Array(value)
  def getQuantileBreaks(num:Int):Array[Int] = Array(value)
  def mutable():MutableHistogram = {
    val fmh = FastMapHistogram(size)
    fmh.setItem(value,size)
    fmh
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy