OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 17 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
17 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
182 ilm 4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
17 ilm 5
 *
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.utils.cc;
15
 
16
import java.util.Collection;
17
import java.util.LinkedList;
18
 
19
/**
20
 * An IdentitySet maintaining insertion order.
21
 *
22
 * @param <E> the type of elements maintained by this set
23
 * @see IdentityHashSet
24
 */
182 ilm 25
public final class LinkedIdentitySet<E> extends ListIdentitySet<E> implements Cloneable {
17 ilm 26
 
27
    public LinkedIdentitySet() {
182 ilm 28
        super();
17 ilm 29
    }
30
 
182 ilm 31
    public LinkedIdentitySet(int expectedSize) {
32
        super(expectedSize);
17 ilm 33
    }
34
 
182 ilm 35
    public LinkedIdentitySet(Collection<? extends E> c) {
36
        super(c);
17 ilm 37
    }
38
 
39
    @Override
182 ilm 40
    protected LinkedList<E> newList(int expectedSize) {
41
        return new LinkedList<>();
17 ilm 42
    }
43
 
44
    /**
45
     * Returns a shallow copy of this <tt>HashSet</tt> instance: the elements themselves are not
46
     * cloned.
47
     *
48
     * @return a shallow copy of this set
49
     */
182 ilm 50
    @Override
17 ilm 51
    public Object clone() {
52
        return new LinkedIdentitySet<E>(this);
53
    }
54
 
55
}