Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.*;

public class Main {

    public static boolean containsMap(Map mainMap, Map keyMap) {
        boolean b = true;
        if (mainMap != null && keyMap != null) {
            Set set = keyMap.keySet();
            for (Iterator iter = set.iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                String mainValue = (String) mainMap.get(key);
                String keyValue = (String) keyMap.get(key);
                if (!mainValue.equals(keyValue)) {
                    b = false;
                }
            }
        } else {
            b = false;
        }
        return b;
    }
}