Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.concurrent.*;

public class Main {
    protected static int CCHM_INITIAL_CAPACITY = 16;
    protected static float CCHM_LOAD_FACTOR = 0.75f;
    protected static int CCHM_CONCURRENCY_LEVEL = 16;

    public static <K, V> ConcurrentMap<K, V> createConcurrentMap(int initial_capacity, float load_factor,
            int concurrency_level) {
        return new ConcurrentHashMap<K, V>(initial_capacity, load_factor, concurrency_level);
    }

    public static <K, V> ConcurrentMap<K, V> createConcurrentMap(int initial_capacity) {
        return new ConcurrentHashMap<K, V>(initial_capacity);
    }

    public static <K, V> ConcurrentMap<K, V> createConcurrentMap() {
        return new ConcurrentHashMap<K, V>(CCHM_INITIAL_CAPACITY, CCHM_LOAD_FACTOR, CCHM_CONCURRENCY_LEVEL);
    }
}