Java tutorial
//package com.java2s; /* * File: $RCSfile$ * * Copyright (c) 2005 Wincor Nixdorf International GmbH, * Heinz-Nixdorf-Ring 1, 33106 Paderborn, Germany * All Rights Reserved. * * This software is the confidential and proprietary information * of Wincor Nixdorf ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered * into with Wincor Nixdorf. */ import java.util.Map; import java.util.Iterator; import java.util.Set; public class Main { /** * Check whether map contains value * * @param map specified map * @return boolean value */ public static boolean isEmpty(Map map) { boolean isEmpty = true; if (map != null) { Set keySet = map.keySet(); Iterator it = keySet.iterator(); while (it.hasNext()) { if (map.get(it.next()) != null) { isEmpty = false; break; } } } return isEmpty; } }