MCPcopy Index your code
hub / github.com/OpenEndedGroup/Field2 / FileMap

Class FileMap

src/main/java/trace/video/ImageCache.kt:185–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183
184 private var remap: Array<Int>
185
186 init {
187 remap = Array<Int>(ff.size, { it })
188 }
189
190 fun length(): Int {
191 return remap.size
192 }
193
194 override fun apply(x: Int): String {
195 var x = x
196 if (x < 0) x = 0
197 return ff[remap[x!! % remap.size]]!!.absolutePath
198 }
199
200 fun remap(num: Int, mapper: Function<Int, Int>) {
201 remap = Array<Int>(ff.size, { mapper.apply(it) })
202 }
203 }
204
205 companion object {
206
207 var synchronous = Options.dict().isTrue(Dict.Prop<Int>("offline"), false)
208
209 fun mapFromDirectory(dir: String, match: String): FileMap {
210
211 val f = File(dir)
212 val ff = f.listFiles { dir, name -> name.matches(match.toRegex()) }
213
214 Arrays.sort(ff!!)
215
216 return FileMap(ff)
217 }
218
219 fun mapFromDirectory(dir: String, match: String, dec: Int): FileMap {
220
221 val f = File(dir)
222 val ff = f.listFiles { dir, name -> name.matches(match.toRegex()) }

Callers 1

mapFromDirectoryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected