Files
pj2/doc/edu/rit/util/IdentityMap.html
2016-04-27 01:07:35 -04:00

331 lines
18 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Wed Apr 06 13:11:11 EDT 2016 -->
<title>IdentityMap (Parallel Java 2 Library Documentation)</title>
<meta name="date" content="2016-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IdentityMap (Parallel Java 2 Library Documentation)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/IdentityMap.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../edu/rit/util/Hex.html" title="class in edu.rit.util"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../edu/rit/util/IdentityPair.html" title="class in edu.rit.util"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?edu/rit/util/IdentityMap.html" target="_top">Frames</a></li>
<li><a href="IdentityMap.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">edu.rit.util</div>
<h2 title="Class IdentityMap" class="title">Class IdentityMap&lt;K,V&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">edu.rit.util.Map</a>&lt;K,V&gt;</li>
<li>
<ul class="inheritance">
<li>edu.rit.util.IdentityMap&lt;K,V&gt;</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>K</code> - Key data type.</dd><dd><code>V</code> - Value data type.</dd></dl>
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../edu/rit/io/Streamable.html" title="interface in edu.rit.io">Streamable</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang">Cloneable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">IdentityMap&lt;K,V&gt;</span>
extends <a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a>&lt;K,V&gt;</pre>
<div class="block">Class IdentityMap provides a mapping from keys to values with reference
equality semantics. Two (key, value) mappings are equal if their keys refer
to the same object. That is, equality of keys is tested using the <TT>==</TT>
operator rather than the <TT>equals()</TT> method.
<P>
Keys must not be null. Once a key is stored in a map, the state of the key
must not be altered. The value may be any object. Values may be null. Once a
value is stored in a map, the state of the value may be altered, and the
value may be replaced by a different object.
<P>
The map calls the protected <a href="../../../edu/rit/util/IdentityMap.html#getPair(K, V)"><code>getPair()</code></a> method
to make (key, value) mappings (pairs). The default is to copy just the key
and value references. This behavior can be changed by overriding the <a href="../../../edu/rit/util/IdentityMap.html#getPair(K, V)"><code>getPair()</code></a> method in a subclass.
<P>
Class IdentityMap is streamable. For object streaming to work properly, the
key and the value classes must be streamable or serializable.
<P>
<I>Note:</I> Class IdentityMap is not multiple thread safe.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../edu/rit/util/IdentityMap.html#IdentityMap()">IdentityMap</a></strong>()</code>
<div class="block">Construct a new empty map.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../edu/rit/util/IdentityMap.html#IdentityMap(edu.rit.util.Map)">IdentityMap</a></strong>(<a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a>&lt;<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">K</a>,<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">V</a>&gt;&nbsp;map)</code>
<div class="block">Construct a new map that is a copy of the given map.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a>&lt;<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">K</a>,<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">V</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/util/IdentityMap.html#getPair(K, V)">getPair</a></strong>(<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">K</a>&nbsp;key,
<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">V</a>&nbsp;value)</code>
<div class="block">Create a pair containing the given key and value.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_edu.rit.util.Map">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;edu.rit.util.<a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a></h3>
<code><a href="../../../edu/rit/util/Map.html#clear()">clear</a>, <a href="../../../edu/rit/util/Map.html#clone()">clone</a>, <a href="../../../edu/rit/util/Map.html#contains(K)">contains</a>, <a href="../../../edu/rit/util/Map.html#copy(edu.rit.util.Map)">copy</a>, <a href="../../../edu/rit/util/Map.html#copyKey(K)">copyKey</a>, <a href="../../../edu/rit/util/Map.html#copyValue(V)">copyValue</a>, <a href="../../../edu/rit/util/Map.html#forEachItemDo(edu.rit.util.Action)">forEachItemDo</a>, <a href="../../../edu/rit/util/Map.html#forEachItemDo(edu.rit.util.ActionResult)">forEachItemDo</a>, <a href="../../../edu/rit/util/Map.html#forEachKeyDo(edu.rit.util.Action)">forEachKeyDo</a>, <a href="../../../edu/rit/util/Map.html#forEachKeyDo(edu.rit.util.ActionResult)">forEachKeyDo</a>, <a href="../../../edu/rit/util/Map.html#forEachValueDo(edu.rit.util.Action)">forEachValueDo</a>, <a href="../../../edu/rit/util/Map.html#forEachValueDo(edu.rit.util.ActionResult)">forEachValueDo</a>, <a href="../../../edu/rit/util/Map.html#get(K)">get</a>, <a href="../../../edu/rit/util/Map.html#inverseGet(V)">inverseGet</a>, <a href="../../../edu/rit/util/Map.html#isEmpty()">isEmpty</a>, <a href="../../../edu/rit/util/Map.html#keysToArray(K[])">keysToArray</a>, <a href="../../../edu/rit/util/Map.html#keysToArray(K[], int, int)">keysToArray</a>, <a href="../../../edu/rit/util/Map.html#put(K, V)">put</a>, <a href="../../../edu/rit/util/Map.html#readIn(edu.rit.io.InStream)">readIn</a>, <a href="../../../edu/rit/util/Map.html#remove(K)">remove</a>, <a href="../../../edu/rit/util/Map.html#removeEachItemIf(edu.rit.util.Predicate)">removeEachItemIf</a>, <a href="../../../edu/rit/util/Map.html#removeEachKeyIf(edu.rit.util.Predicate)">removeEachKeyIf</a>, <a href="../../../edu/rit/util/Map.html#removeEachValueIf(edu.rit.util.Predicate)">removeEachValueIf</a>, <a href="../../../edu/rit/util/Map.html#size()">size</a>, <a href="../../../edu/rit/util/Map.html#toArray(edu.rit.util.Pair[])">toArray</a>, <a href="../../../edu/rit/util/Map.html#toArray(edu.rit.util.Pair[], int, int)">toArray</a>, <a href="../../../edu/rit/util/Map.html#valuesToArray(V[])">valuesToArray</a>, <a href="../../../edu/rit/util/Map.html#valuesToArray(V[], int, int)">valuesToArray</a>, <a href="../../../edu/rit/util/Map.html#writeOut(edu.rit.io.OutStream)">writeOut</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="IdentityMap()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>IdentityMap</h4>
<pre>public&nbsp;IdentityMap()</pre>
<div class="block">Construct a new empty map.</div>
</li>
</ul>
<a name="IdentityMap(edu.rit.util.Map)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>IdentityMap</h4>
<pre>public&nbsp;IdentityMap(<a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a>&lt;<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">K</a>,<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">V</a>&gt;&nbsp;map)</pre>
<div class="block">Construct a new map that is a copy of the given map.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>map</code> - Map to copy.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - (unchecked exception) Thrown if <TT>map</TT> is null.</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getPair(java.lang.Object,java.lang.Object)">
<!-- -->
</a><a name="getPair(K, V)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getPair</h4>
<pre>protected&nbsp;<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a>&lt;<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">K</a>,<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">V</a>&gt;&nbsp;getPair(<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">K</a>&nbsp;key,
<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">V</a>&nbsp;value)</pre>
<div class="block">Create a pair containing the given key and value. Whenever class
IdentityMap needs to create a pair, it does so by calling this method.
<P>
The <TT>getPair()</TT> method in class IdentityMap returns an instance of
class <a href="../../../edu/rit/util/IdentityPair.html" title="class in edu.rit.util">IdentityPair</a>&lt;K,V&gt; consisting of the
given <TT>key</TT> and <TT>value</TT> references.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../edu/rit/util/Map.html#getPair(K, V)">getPair</a></code>&nbsp;in class&nbsp;<code><a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a>&lt;<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">K</a>,<a href="../../../edu/rit/util/IdentityMap.html" title="type parameter in IdentityMap">V</a>&gt;</code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key.</dd><dd><code>value</code> - Value.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Pair consisting of (key, value).</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/IdentityMap.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../edu/rit/util/Hex.html" title="class in edu.rit.util"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../edu/rit/util/IdentityPair.html" title="class in edu.rit.util"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?edu/rit/util/IdentityMap.html" target="_top">Frames</a></li>
<li><a href="IdentityMap.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><FONT SIZE="-2">Copyright &copy; 2013&ndash;2016 by Alan Kaminsky. All rights reserved. Send comments to ark</FONT><FONT SIZE="1" COLOR="#FFFFFF">&shy;</FONT><FONT SIZE="-2">&#64;</FONT><FONT SIZE="1" COLOR="#FFFFFF">&shy;</FONT><FONT SIZE="-2">cs.rit.edu.</FONT></small></p>
</body>
</html>