purereborn
09/22/2017, 6:28 PMclass CustomBiConsumer : BiConsumer<MutableList<MutableList<String>>, String> {
override fun accept(stringGroups: MutableList<MutableList<String>>, line: String) {
if (line.isEmpty()) return
if (line.matches(MacParser.NAME_REGEX)) {
stringGroups.add(ArrayList())
}
stringGroups.last().add(line)
}
}
so for @kevinmost 's problem with IntRanges it'd be something like
class IntRangeBiConsumer : BiConsumer<MutableList<IntRange>, IntRange> {
override fun accept(ranges: MutableList<IntRange>, range: IntRange) {
r = findOverLappingIntRange(range)
if (r) {
// replace with wider int range
} else {
ranges.add(range) //add new int range
}
}
}
with the other classes updated to take MutableList<IntRange> instead