Mercurial > jhg
comparison src/org/tmatesoft/hg/util/DirectHashSet.java @ 467:51d682cf9cdc
Cleaned experimental tag and updated comments/javadoc
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Fri, 22 Jun 2012 17:39:31 +0200 |
| parents | 85b8efde5586 |
| children |
comparison
equal
deleted
inserted
replaced
| 466:3ace1fc95d0a | 467:51d682cf9cdc |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 TMate Software Ltd | 2 * Copyright (c) 2011-2012 TMate Software Ltd |
| 3 * | 3 * |
| 4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
| 5 * it under the terms of the GNU General Public License as published by | 5 * it under the terms of the GNU General Public License as published by |
| 6 * the Free Software Foundation; version 2 of the License. | 6 * the Free Software Foundation; version 2 of the License. |
| 7 * | 7 * |
| 14 * the terms of a license other than GNU General Public License | 14 * the terms of a license other than GNU General Public License |
| 15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com |
| 16 */ | 16 */ |
| 17 package org.tmatesoft.hg.util; | 17 package org.tmatesoft.hg.util; |
| 18 | 18 |
| 19 import org.tmatesoft.hg.internal.Experimental; | |
| 20 | 19 |
| 21 /** | 20 /** |
| 22 * Memory-friendly alternative to HashSet. With slightly worse performance than that of HashSet, uses n * sizeof(HashMap.Entry) less memory | 21 * Memory-friendly alternative to HashSet. With slightly worse performance than that of HashSet, uses n * sizeof(HashMap.Entry) less memory |
| 23 * (i.e. for set of 50k elements saves more than 1 Mb of memory). Besides, elements of this set can be obtained (not only queried for presence) - | 22 * (i.e. for set of 50k elements saves more than 1 Mb of memory). Besides, elements of this set can be obtained (not only queried for presence) - |
| 24 * the option essential for canonical mappings (aka Pool) | 23 * the option essential for canonical mappings (aka Pool) |
| 25 * | 24 * |
| 26 * @author Artem Tikhomirov | 25 * @author Artem Tikhomirov |
| 27 * @author TMate Software Ltd. | 26 * @author TMate Software Ltd. |
| 28 */ | 27 */ |
| 29 @Experimental | |
| 30 public class DirectHashSet<T> { | 28 public class DirectHashSet<T> { |
| 31 | 29 |
| 32 private Object[] table; | 30 private Object[] table; |
| 33 private int size; | 31 private int size; |
| 34 private int threshold; | 32 private int threshold; |
