📄 concurrenthashmap.html
字号:
<DD>The default load factor for this table (0.75) Used when not otherwise specified in constructor.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#com.cmcc.mm7.vasp.common.ConcurrentHashMap.DEFAULT_LOAD_FACTOR">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="loadFactor"><!-- --></A><H3>
loadFactor</H3>
<PRE>
protected final float <B>loadFactor</B></PRE>
<DL>
<DD>The load factor for the hash table.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="threshold"><!-- --></A><H3>
threshold</H3>
<PRE>
protected int <B>threshold</B></PRE>
<DL>
<DD>Per-segment resize threshold.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="votesForResize"><!-- --></A><H3>
votesForResize</H3>
<PRE>
protected transient volatile int <B>votesForResize</B></PRE>
<DL>
<DD>Number of segments voting for resize. The table is doubled when 1/4 of the segments reach threshold. Volatile but updated without synch since this is just a heuristic.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="keySet"><!-- --></A><H3>
keySet</H3>
<PRE>
protected transient java.util.Set <B>keySet</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="entrySet"><!-- --></A><H3>
entrySet</H3>
<PRE>
protected transient java.util.Set <B>entrySet</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="values"><!-- --></A><H3>
values</H3>
<PRE>
protected transient java.util.Collection <B>values</B></PRE>
<DL>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="ConcurrentHashMap(int, float)"><!-- --></A><H3>
ConcurrentHashMap</H3>
<PRE>
public <B>ConcurrentHashMap</B>(int initialCapacity, float loadFactor)</PRE>
<DL>
<DD>Constructs a new, empty map with the specified initial capacity and the specified load factor.
<P>
<DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - the initial capacity. The actual initial capacity is rounded to the nearest power of two.<DD><CODE>loadFactor</CODE> - the load factor threshold, used to control resizing. This value is used in an approximate way: When at least a quarter of the segments of the table reach per-segment threshold, or one of the segments itself exceeds overall threshold, the table is doubled. This will on average cause resizing when the table-wide load factor is slightly less than the threshold. If you'd like to avoid resizing, you can set this to a ridiculously large value.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the load factor is nonpositive.</DL>
<HR>
<A NAME="ConcurrentHashMap(int)"><!-- --></A><H3>
ConcurrentHashMap</H3>
<PRE>
public <B>ConcurrentHashMap</B>(int initialCapacity)</PRE>
<DL>
<DD>Constructs a new, empty map with the specified initial capacity and default load factor.
<P>
<DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - the initial capacity of the ConcurrentHashMap.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the initial maximum number of elements is less than zero.</DL>
<HR>
<A NAME="ConcurrentHashMap()"><!-- --></A><H3>
ConcurrentHashMap</H3>
<PRE>
public <B>ConcurrentHashMap</B>()</PRE>
<DL>
<DD>Constructs a new, empty map with a default initial capacity and default load factor.
<P>
</DL>
<HR>
<A NAME="ConcurrentHashMap(java.util.Map)"><!-- --></A><H3>
ConcurrentHashMap</H3>
<PRE>
public <B>ConcurrentHashMap</B>(java.util.Map t)</PRE>
<DL>
<DD>Constructs a new map with the same mappings as the given map. The map is created with a capacity of twice the number of mappings in the given map or 32 (whichever is greater), and a default load factor.
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="bitcount(int)"><!-- --></A><H3>
bitcount</H3>
<PRE>
protected static int <B>bitcount</B>(int w)</PRE>
<DL>
<DD>Return the number of set bits in w. For a derivation of this algorithm, see "Algorithms and data structures with applications to graphics and geometry", by Jurg Nievergelt and Klaus Hinrichs, Prentice Hall, 1993. See also notes by Torsten Sillke at http://www.mathematik.uni-bielefeld.de/~sillke/PROBLEMS/bitcount
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="hash(java.lang.Object)"><!-- --></A><H3>
hash</H3>
<PRE>
protected static int <B>hash</B>(java.lang.Object x)</PRE>
<DL>
<DD>Return hash code for Object x. Since we are using power-of-two tables, it is worth the effort to improve hashcode via the same multiplicative scheme as used in IdentityHashMap.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="eq(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
eq</H3>
<PRE>
protected boolean <B>eq</B>(java.lang.Object x, java.lang.Object y)</PRE>
<DL>
<DD>Check for equality of non-null references x and y.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="newTable(int)"><!-- --></A><H3>
newTable</H3>
<PRE>
protected <A HREF="../../../../../com/cmcc/mm7/vasp/common/ConcurrentHashMap.Entry.html">ConcurrentHashMap.Entry</A>[] <B>newTable</B>(int capacity)</PRE>
<DL>
<DD>Create table array and set the per-segment threshold
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="size()"><!-- --></A><H3>
size</H3>
<PRE>
public int <B>size</B>()</PRE>
<DL>
<DD>Returns the number of key-value mappings in this map.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>size</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>size</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the number of key-value mappings in this map.</DL>
</DD>
</DL>
<HR>
<A NAME="isEmpty()"><!-- --></A><H3>
isEmpty</H3>
<PRE>
public boolean <B>isEmpty</B>()</PRE>
<DL>
<DD>Returns <tt>true</tt> if this map contains no key-value mappings.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>isEmpty</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>isEmpty</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD><tt>true</tt> if this map contains no key-value mappings.</DL>
</DD>
</DL>
<HR>
<A NAME="get(java.lang.Object)"><!-- --></A><H3>
get</H3>
<PRE>
public java.lang.Object <B>get</B>(java.lang.Object key)</PRE>
<DL>
<DD>Returns the value to which the specified key is mapped in this table.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>get</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>get</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - a key in the table.<DT><B>Returns:</B><DD>the value to which the key is mapped in this table; <code>null</code> if the key is not mapped to any value in this table.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the key is <code>null</code>.<DT><B>See Also:</B><DD><A HREF="../../../../../com/cmcc/mm7/vasp/common/ConcurrentHashMap.html#put(java.lang.Object, java.lang.Object)"><CODE>put(Object, Object)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="containsKey(java.lang.Object)"><!-- --></A><H3>
containsKey</H3>
<PRE>
public boolean <B>containsKey</B>(java.lang.Object key)</PRE>
<DL>
<DD>Tests if the specified object is a key in this table.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>containsKey</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>containsKey</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - possible key.<DT><B>Returns:</B><DD><code>true</code> if and only if the specified object is a key in this table, as determined by the <tt>equals</tt> method; <code>false</code> otherwise.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the key is <code>null</code>.<DT><B>See Also:</B><DD><A HREF="../../../../../com/cmcc/mm7/vasp/common/ConcurrentHashMap.html#contains(java.lang.Object)"><CODE>contains(Object)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="put(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
put</H3>
<PRE>
public java.lang.Object <B>put</B>(java.lang.Object key, java.lang.Object value)</PRE>
<DL>
<DD>Maps the specified <code>key</code> to the specified <code>value</code> in this table. Neither the key nor the value can be <code>null</code>. (Note that this policy is the same as for java.util.Hashtable, but unlike java.util.HashMap, which does accept nulls as valid keys and values.)<p> The value can be retrieved by calling the <code>get</code> method with a key that is equal to the original key.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>put</CODE> in interface <CODE>java.util.Map</CODE><DT><B>Overrides:</B><DD><CODE>put</CODE> in class <CODE>java.util.AbstractMap</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the table key.<DD><CODE>value</CODE> - the value.<DT><B>Returns:</B><DD>the previous value of the specified key in this table, or <code>null</code> if it did not have one.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the key or value is <code>null</code>.<DT><B>See Also:</B><DD><CODE>Object.equals(Object)</CODE>, <A HREF="../../../../../com/cmcc/mm7/vasp/common/ConcurrentHashMap.html#get(java.lang.Object)"><CODE>get(Object)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="resize(int, com.cmcc.mm7.vasp.common.ConcurrentHashMap.Entry[])"><!-- --></A><H3>
resize</H3>
<PRE>
protected void <B>resize</B>(int index, <A HREF="../../../../../com/cmcc/mm7/vasp/common/ConcurrentHashMap.Entry.html">ConcurrentHashMap.Entry</A>[] assumedTab)</PRE>
<DL>
<DD>Gather all locks in order to call rehash, by recursing within synch blocks for each segment index.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -