MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / getAnalysis

Method getAnalysis

src/main/java/trace/video/Analysis.kt:29–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 @JvmStatic
28 fun getAnalysis(name: String, directory: String): SimpleAnalysis {
29 if (File(directory + "/" + name + ".csv").exists()) return SimpleAnalysis(directory + "/" + name + ".csv")
30 if (registry.containsKey(name)) {
31 val res = registry.get(name)!!.perform(File(directory).list(FilenameFilter { d, name -> name.endsWith(".jpg") }).sorted().map { File(directory, it) }.toList())
32 PrintWriter(FileWriter(File(directory + "/" + name + ".csv"))).use { writer ->
33 res.forEach {
34 writer.println(it.joinToString(",", transform = { it.toString() }))
35 }
36 }
37 return SimpleAnalysis(directory + "/" + name + ".csv")
38 } else
39 throw IllegalArgumentException("can't find an analysis called $name")
40 }
41
42
43}

Callers

nothing calls this directly

Calls 10

FileFunction · 0.85
SimpleAnalysisClass · 0.85
existsMethod · 0.80
performMethod · 0.65
getMethod · 0.65
containsKeyMethod · 0.45
mapMethod · 0.45
forEachMethod · 0.45
printlnMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected