Commit 8920e44e authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added getThreads function

parent 26420c84
......@@ -125,6 +125,13 @@ class Config(var map: Map[String,Any]) extends Logging {
}
def getAsConfig(s:String) : Config = if (contains(s)) new Config(getAsMap(s)) else new Config(Map())
def getThreads(default:Int) : Int = {
val maxThreads = this.getAsInt("maxthreads", 8)
val threads = this.getAsInt("threads", default)
if (maxThreads > threads) return threads
else return maxThreads
}
override def toString() : String = map.toString
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment