Example usage for java.util EnumMap containsValue

List of usage examples for java.util EnumMap containsValue

Introduction

In this page you can find the example usage for java.util EnumMap containsValue.

Prototype

public boolean containsValue(Object value) 

Source Link

Document

Returns true if this map maps one or more keys to the specified value.

Usage

From source file:Tutorial.java

public static void main(String[] args) {
    EnumMap<Tutorial, String> map = new EnumMap<Tutorial, String>(Tutorial.class);

    map.put(Tutorial.CSS, "1");
    map.put(Tutorial.Python, "2");
    map.put(Tutorial.PHP, "3");
    map.put(Tutorial.Java, "4");

    System.out.println(map);/*  w w w  . j a  va 2s.c o m*/

    boolean contains = map.containsValue("1");

    System.out.println("Map contains '1':" + contains);

    contains = map.containsValue("5");

    System.out.println("Map contains '5':" + contains);

}