Create new Concurrent Skip List Set - Java java.util

Java examples for java.util:List Creation

Description

Create new Concurrent Skip List Set

Demo Code


//package com.java2s;

import java.util.Collection;
import java.util.Comparator;

import java.util.SortedSet;

import java.util.concurrent.ConcurrentSkipListSet;

public class Main {
    public static void main(String[] argv) {
        System.out.println(newConcurrentSkipListSet());
    }//from   w w  w  . ja  va2s  .  c om

    public static <E> ConcurrentSkipListSet<E> newConcurrentSkipListSet() {
        return new ConcurrentSkipListSet<E>();
    }

    public static <E> ConcurrentSkipListSet<E> newConcurrentSkipListSet(
            final Collection<? extends E> c) {
        return new ConcurrentSkipListSet<E>(c);
    }

    public static <E> ConcurrentSkipListSet<E> newConcurrentSkipListSet(
            final Comparator<? super E> c) {
        return new ConcurrentSkipListSet<E>(c);
    }

    public static <E> ConcurrentSkipListSet<E> newConcurrentSkipListSet(
            final SortedSet<? extends E> s) {
        return new ConcurrentSkipListSet<E>(s);
    }
}

Related Tutorials