Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.HashMap;
import java.util.Map;

import android.database.Cursor;

public class Main {
    public static Map<String, Integer> getColumnMap(Cursor cursor) {
        Map<String, Integer> retMap = new HashMap<String, Integer>();
        int nCols = cursor.getColumnCount();
        for (int i = 0; i < nCols; i++) {
            retMap.put(cursor.getColumnName(i), i);
        }
        return retMap;
    }
}