Create new Concurrent Skip List Map - Java java.util

Java examples for java.util:List Creation

Description

Create new Concurrent Skip List Map

Demo Code


//package com.java2s;

import java.util.Comparator;

import java.util.Map;

import java.util.SortedMap;

import java.util.concurrent.ConcurrentSkipListMap;

public class Main {
    public static void main(String[] argv) {
        System.out.println(newConcurrentSkipListMap());
    }/*from  w  w w. java 2s  . c  o m*/

    public static <K, V> ConcurrentSkipListMap<K, V> newConcurrentSkipListMap() {
        return new ConcurrentSkipListMap<K, V>();
    }

    public static <K, V> ConcurrentSkipListMap<K, V> newConcurrentSkipListMap(
            final Comparator<? super K> c) {
        return new ConcurrentSkipListMap<K, V>(c);
    }

    public static <K, V> ConcurrentSkipListMap<K, V> newConcurrentSkipListMap(
            final Map<? extends K, ? extends V> m) {
        return new ConcurrentSkipListMap<K, V>(m);
    }

    public static <K, V> ConcurrentSkipListMap<K, V> newConcurrentSkipListMap(
            final SortedMap<K, ? extends V> m) {
        return new ConcurrentSkipListMap<K, V>(m);
    }
}

Related Tutorials