Example usage for java.util EnumMap clear

List of usage examples for java.util EnumMap clear

Introduction

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

Prototype

public void clear() 

Source Link

Document

Removes all mappings from this map.

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 .  jav  a  2 s  .c o  m

    map.clear();

    System.out.println(map);

}

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

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

}

From source file:org.codehaus.mojo.license.UpdateFileHeaderMojo.java

protected void clear() {
    Set<File> files = getProcessedFiles();
    if (files != null) {
        files.clear();/* w w  w.j ava  2 s  .  c  om*/
    }
    EnumMap<FileState, Set<File>> result = getResult();
    if (result != null) {
        for (Set<File> fileSet : result.values()) {
            fileSet.clear();
        }
        result.clear();
    }
}