If you go to Github and do this search , you will see that there are two files where MapRowParser is referenced in some way.
The first file contains the following:
interface MapRowParser<out T> {
fun parseRow(columns: Map<String, Any?>): T
}
What MapRowParser shows as an interface.
. , , MapRowParser. , , . , , . , Anko , MapRowParser.
, , MapRowParser . , , , , , .
RowParser. . , . RowMapParser.
EDIT:
, . , MapRowParser , . , , , :
private class SingleColumnParser<out T> : RowParser<T> {
override fun parseRow(columns: Array<Any?>): T {
if (columns.size != 1)
throw SQLiteException("Invalid row: row for SingleColumnParser must contain exactly one column")
@Suppress("UNCHECKED_CAST")
return columns[0] as T
}
}
, . , , , , , .
:
private fun readColumnsMap(cursor: Cursor): Map<String, Any?> {
val count = cursor.columnCount
val map = hashMapOf<String, Any?>()
for (i in 0..(count - 1)) {
map.put(cursor.getColumnName(i), cursor.getColumnValue(i))
}
return map
}
, . , - :
Col1 -> Row1col1val
Col2 -> Row1col2val
...
, :
moveToFirst()
while (!isAfterLast) {
list.add(parser.parseRow(readColumnsMap(this)))
moveToNext()
}
, , , , , , .
* , , .. , , , MapRowParser, , . , , blob, , .
* , , . , ,
. , , . . Maps , , , .