Example usage for java.util EnumMap hashCode

List of usage examples for java.util EnumMap hashCode

Introduction

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

Prototype

public int hashCode() 

Source Link

Document

Returns the hash code value for this map.

Usage

From source file:Tutorial.java

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

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

    System.out.println(map.hashCode());

}

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.hashCode());

}

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.hashCode());

    map.clear();//  w ww. ja v  a2s .  c  o  m

    System.out.println(map.hashCode());

}

From source file:Tutorial.java

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

    EnumMap<Tutorial, String> map1 = new EnumMap<Tutorial, String>(map);

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

    System.out.println(map.hashCode());

}