Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// Licensed under the Apache License, Version 2.0

import java.util.ArrayList;
import java.util.HashMap;

import android.content.ContentValues;

public class Main {
    public static void shiftTableIds(HashMap<String, ArrayList<ContentValues>> operationMap, String tableName,
            String idColumnName, long topTableId) {
        ArrayList<ContentValues> restoreOperations = operationMap.get(tableName);
        if (null == restoreOperations) {
            return;
        }
        for (ContentValues restoreCv : restoreOperations) {
            restoreCv.put(idColumnName, restoreCv.getAsLong(idColumnName) + topTableId);
        }
    }
}