1115 lines
66 KiB
HTML
1115 lines
66 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>Map (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="Map (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/Map.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/LongPredicate.html" title="interface in edu.rit.util"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../edu/rit/util/MultiSet.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/Map.html" target="_top">Frames</a></li>
|
|
<li><a href="Map.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: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_summary">Constr</a> | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_detail">Constr</a> | </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 Map" class="title">Class Map<K,V></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>edu.rit.util.Map<K,V></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>
|
|
<dl>
|
|
<dt>Direct Known Subclasses:</dt>
|
|
<dd><a href="../../../edu/rit/pjmr/Combiner.html" title="class in edu.rit.pjmr">Combiner</a>, <a href="../../../edu/rit/util/IdentityMap.html" title="class in edu.rit.util">IdentityMap</a></dd>
|
|
</dl>
|
|
<hr>
|
|
<br>
|
|
<pre>public class <span class="strong">Map<K,V></span>
|
|
extends <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>
|
|
implements <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></pre>
|
|
<div class="block">Class Map provides a mapping from keys to values. The key must be an object
|
|
suitable for use in a hashed data structure; that is, the key class must
|
|
define the <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"><code>equals()</code></a> and <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"><code>hashCode()</code></a> methods properly. Keys may 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/Map.html#getPair(K, V)"><code>getPair()</code></a> method
|
|
to make a key-value mapping (pair) being added to the map. The map calls the
|
|
protected <a href="../../../edu/rit/util/Map.html#copyKey(K)"><code>copyKey()</code></a> method to make a copy of a key
|
|
being added to the map. The map calls the protected <a href="../../../edu/rit/util/Map.html#copyValue(V)"><code>copyValue()</code></a> method to make a copy of a value being added to the map. The
|
|
default is to copy just the key and value references. This behavior can be
|
|
changed by overriding the aforementioned methods in a subclass of class Map.
|
|
<P>
|
|
Class Map is streamable. For object streaming to work properly, the key and
|
|
the value classes must be streamable or serializable.
|
|
<P>
|
|
<I>Note:</I> Class Map 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"> </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/Map.html#Map()">Map</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/Map.html#Map(edu.rit.util.Map)">Map</a></strong>(<a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>> 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"> </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>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#clear()">clear</a></strong>()</code>
|
|
<div class="block">Clear this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><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></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#clone()">clone</a></strong>()</code>
|
|
<div class="block">Create a clone of this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#contains(K)">contains</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key)</code>
|
|
<div class="block">Determine if this map contains the given key.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#copy(edu.rit.util.Map)">copy</a></strong>(<a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>> map)</code>
|
|
<div class="block">Change this map to be a copy of the given map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#copyKey(K)">copyKey</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key)</code>
|
|
<div class="block">Copy the given key.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>protected <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#copyValue(V)">copyValue</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> value)</code>
|
|
<div class="block">Copy the given value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#forEachItemDo(edu.rit.util.Action)">forEachItemDo</a></strong>(<a href="../../../edu/rit/util/Action.html" title="interface in edu.rit.util">Action</a><<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>> action)</code>
|
|
<div class="block">Perform the given action on each key-value mapping in this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><R> R</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#forEachItemDo(edu.rit.util.ActionResult)">forEachItemDo</a></strong>(<a href="../../../edu/rit/util/ActionResult.html" title="interface in edu.rit.util">ActionResult</a><<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>,R> action)</code>
|
|
<div class="block">Perform the given action on each key-value mapping in this map and return
|
|
a result.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#forEachKeyDo(edu.rit.util.Action)">forEachKeyDo</a></strong>(<a href="../../../edu/rit/util/Action.html" title="interface in edu.rit.util">Action</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>> action)</code>
|
|
<div class="block">Perform the given action on each key in this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><R> R</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#forEachKeyDo(edu.rit.util.ActionResult)">forEachKeyDo</a></strong>(<a href="../../../edu/rit/util/ActionResult.html" title="interface in edu.rit.util">ActionResult</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,R> action)</code>
|
|
<div class="block">Perform the given action on each key in this map and return a result.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#forEachValueDo(edu.rit.util.Action)">forEachValueDo</a></strong>(<a href="../../../edu/rit/util/Action.html" title="interface in edu.rit.util">Action</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>> action)</code>
|
|
<div class="block">Perform the given action on each value in this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><R> R</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#forEachValueDo(edu.rit.util.ActionResult)">forEachValueDo</a></strong>(<a href="../../../edu/rit/util/ActionResult.html" title="interface in edu.rit.util">ActionResult</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>,R> action)</code>
|
|
<div class="block">Perform the given action on each value in this map and return a result.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#get(K)">get</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key)</code>
|
|
<div class="block">Get the value associated with the given key in this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>protected <a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#getPair(K, V)">getPair</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key,
|
|
<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> value)</code>
|
|
<div class="block">Create a pair containing the given key and value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#inverseGet(V)">inverseGet</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> value)</code>
|
|
<div class="block">Get the key associated with the given value in this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#isEmpty()">isEmpty</a></strong>()</code>
|
|
<div class="block">Determine if this map is empty.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>[]</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#keysToArray(K[])">keysToArray</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>[] array)</code>
|
|
<div class="block">Store this map's keys in the given array.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>[]</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#keysToArray(K[], int, int)">keysToArray</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>[] array,
|
|
int off,
|
|
int len)</code>
|
|
<div class="block">Store this map's keys in a portion of the given array.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#put(K, V)">put</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key,
|
|
<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> value)</code>
|
|
<div class="block">Map the given key to the given value in this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#readIn(edu.rit.io.InStream)">readIn</a></strong>(<a href="../../../edu/rit/io/InStream.html" title="class in edu.rit.io">InStream</a> in)</code>
|
|
<div class="block">Read this object's fields from the given in stream.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#remove(K)">remove</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key)</code>
|
|
<div class="block">Remove the given key and its associated value from this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#removeEachItemIf(edu.rit.util.Predicate)">removeEachItemIf</a></strong>(<a href="../../../edu/rit/util/Predicate.html" title="interface in edu.rit.util">Predicate</a><<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>> predicate)</code>
|
|
<div class="block">Evaluate the given predicate on, and possibly remove, each key-value
|
|
mapping in this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#removeEachKeyIf(edu.rit.util.Predicate)">removeEachKeyIf</a></strong>(<a href="../../../edu/rit/util/Predicate.html" title="interface in edu.rit.util">Predicate</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>> predicate)</code>
|
|
<div class="block">Evaluate the given predicate on, and possibly remove, each key in this
|
|
map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#removeEachValueIf(edu.rit.util.Predicate)">removeEachValueIf</a></strong>(<a href="../../../edu/rit/util/Predicate.html" title="interface in edu.rit.util">Predicate</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>> predicate)</code>
|
|
<div class="block">Evaluate the given predicate on, and possibly remove, each value in this
|
|
map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#size()">size</a></strong>()</code>
|
|
<div class="block">Returns the number of key-value mappings in this map.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>[]</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#toArray(edu.rit.util.Pair[])">toArray</a></strong>(<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>[] array)</code>
|
|
<div class="block">Store this map's key-value mappings in the given array.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>[]</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#toArray(edu.rit.util.Pair[], int, int)">toArray</a></strong>(<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>[] array,
|
|
int off,
|
|
int len)</code>
|
|
<div class="block">Store this map's key-value mappings in a portion of the given array.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>[]</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#valuesToArray(V[])">valuesToArray</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>[] array)</code>
|
|
<div class="block">Store this map's values in the given array.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>[]</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#valuesToArray(V[], int, int)">valuesToArray</a></strong>(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>[] array,
|
|
int off,
|
|
int len)</code>
|
|
<div class="block">Store this map's values in a portion of the given array.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/util/Map.html#writeOut(edu.rit.io.OutStream)">writeOut</a></strong>(<a href="../../../edu/rit/io/OutStream.html" title="class in edu.rit.io">OutStream</a> out)</code>
|
|
<div class="block">Write this object's fields to the given out stream.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from class 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="Map()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>Map</h4>
|
|
<pre>public Map()</pre>
|
|
<div class="block">Construct a new empty map.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="Map(edu.rit.util.Map)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>Map</h4>
|
|
<pre>public Map(<a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>> map)</pre>
|
|
<div class="block">Construct a new map that is a copy of the given map.
|
|
<P>
|
|
The mappings in the given map are copied using the <a href="../../../edu/rit/util/Map.html#getPair(K, V)"><code>getPair()</code></a> method.</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="isEmpty()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>isEmpty</h4>
|
|
<pre>public boolean isEmpty()</pre>
|
|
<div class="block">Determine if this map is empty.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>True if this map is empty, false otherwise.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="clear()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>clear</h4>
|
|
<pre>public void clear()</pre>
|
|
<div class="block">Clear this map.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="copy(edu.rit.util.Map)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>copy</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>> copy(<a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>> map)</pre>
|
|
<div class="block">Change this map to be a copy of the given map.
|
|
<P>
|
|
The mappings in the given map are copied using the <a href="../../../edu/rit/util/Map.html#getPair(K, V)"><code>getPair()</code></a> method.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>map</code> - Map to copy.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>This map.</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>
|
|
<a name="clone()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>clone</h4>
|
|
<pre>public <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> clone()</pre>
|
|
<div class="block">Create a clone of this map. The clone is a new map that contains copies
|
|
of the mappings in this map.
|
|
<P>
|
|
The mappings in this map are copied using the <a href="../../../edu/rit/util/Map.html#getPair(K, V)"><code>getPair()</code></a> method.</div>
|
|
<dl>
|
|
<dt><strong>Overrides:</strong></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a></code> in class <code><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></code></dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>New set.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="size()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>size</h4>
|
|
<pre>public int size()</pre>
|
|
<div class="block">Returns the number of key-value mappings in this map.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>Number of mappings.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="contains(java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="contains(K)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>contains</h4>
|
|
<pre>public boolean contains(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key)</pre>
|
|
<div class="block">Determine if this map contains the given key.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>True if this map contains <TT>key</TT>, false otherwise.</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>key</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="get(java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="get(K)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>get</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> get(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key)</pre>
|
|
<div class="block">Get the value associated with the given key in this map. If this map does
|
|
not contain <TT>key</TT>, null is returned.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Value associated with <TT>key</TT>, or null.</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>key</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="inverseGet(java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="inverseGet(V)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>inverseGet</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> inverseGet(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> value)</pre>
|
|
<div class="block">Get the key associated with the given value in this map. If this map does
|
|
not contain <TT>value</TT>, null is returned.
|
|
<P>
|
|
The <TT>inverseGet()</TT> method performs a linear search of the
|
|
key-value mappings in this map to find a mapping whose value is equal to
|
|
the given value, as determined by the value class's <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"><code>equals()</code></a> method. If more than one mapping has the
|
|
given value, one such mapping is chosen in an unspecified manner, and the
|
|
chosen mapping's key is returned.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - Value, or null.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Key associated with <TT>value</TT>, or null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="put(java.lang.Object,java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="put(K, V)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>put</h4>
|
|
<pre>public void put(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key,
|
|
<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> value)</pre>
|
|
<div class="block">Map the given key to the given value in this map.
|
|
<P>
|
|
A pair containing the given key and value, created using the <a href="../../../edu/rit/util/Map.html#getPair(K, V)"><code>getPair()</code></a> method, is stored in this map.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key.</dd><dd><code>value</code> - Value.</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>key</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="remove(java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="remove(K)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>remove</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> remove(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key)</pre>
|
|
<div class="block">Remove the given key and its associated value from this map. The value
|
|
formerly associated with <TT>key</TT> is returned. If this map does not
|
|
contain <TT>key</TT>, this map is not altered and null is returned.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Value associated with <TT>key</TT>, or null.</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>key</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="forEachItemDo(edu.rit.util.Action)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>forEachItemDo</h4>
|
|
<pre>public void forEachItemDo(<a href="../../../edu/rit/util/Action.html" title="interface in edu.rit.util">Action</a><<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>> action)</pre>
|
|
<div class="block">Perform the given action on each key-value mapping in this map. For each
|
|
mapping in this map in an unspecified order, the given <TT>action</TT>'s
|
|
<TT>run()</TT> method is called, passing in a pair containing the key and
|
|
the value. The state of the key must not be altered. The state of the
|
|
value may be altered, and the value may be replaced by a different
|
|
object; such changes are reflected in this map.
|
|
<P>
|
|
<B><I>Warning:</I></B> If the <TT>action</TT> adds mappings to or removes
|
|
mappings from the map, the <TT>forEachItemDo()</TT> method's behavior is
|
|
unspecified.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>action</code> - Action.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="forEachItemDo(edu.rit.util.ActionResult)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>forEachItemDo</h4>
|
|
<pre>public <R> R forEachItemDo(<a href="../../../edu/rit/util/ActionResult.html" title="interface in edu.rit.util">ActionResult</a><<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>,R> action)</pre>
|
|
<div class="block">Perform the given action on each key-value mapping in this map and return
|
|
a result. For each mapping in this map in an unspecified order, the given
|
|
<TT>action</TT>'s <TT>run()</TT> method is called, passing in a pair
|
|
containing the key and the value. The state of the key must not be
|
|
altered. The state of the value may be altered, and the value may be
|
|
replaced by a different object; such changes are reflected in this map.
|
|
After all the mappings have been processed, the given <TT>action</TT>'s
|
|
<TT>result()</TT> method is called, and its result is returned.
|
|
<P>
|
|
<B><I>Warning:</I></B> If the <TT>action</TT> adds mappings to or removes
|
|
mappings from the map, the <TT>forEachItemDo()</TT> method's behavior is
|
|
unspecified.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>R</code> - Result data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>action</code> - Action.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Result of processing all the mappings.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="removeEachItemIf(edu.rit.util.Predicate)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>removeEachItemIf</h4>
|
|
<pre>public void removeEachItemIf(<a href="../../../edu/rit/util/Predicate.html" title="interface in edu.rit.util">Predicate</a><<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>> predicate)</pre>
|
|
<div class="block">Evaluate the given predicate on, and possibly remove, each key-value
|
|
mapping in this map. For each mapping in this map in an unspecified
|
|
order, the given <TT>predicate</TT>'s <TT>test()</TT> method is called,
|
|
passing in a pair containing the key and the value. The state of the key
|
|
must not be altered. The state of the value may be altered, and the value
|
|
may be replaced by a different object; such changes are reflected in this
|
|
map. If the <TT>test()</TT> method returns true, the mapping is removed
|
|
from this map.
|
|
<P>
|
|
<B><I>Warning:</I></B> If the <TT>predicate</TT> adds mappings to or
|
|
removes mappings from the map, other than by returning true, the
|
|
<TT>removeEachItemIf()</TT> method's behavior is unspecified.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>predicate</code> - Predicate.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="forEachKeyDo(edu.rit.util.Action)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>forEachKeyDo</h4>
|
|
<pre>public void forEachKeyDo(<a href="../../../edu/rit/util/Action.html" title="interface in edu.rit.util">Action</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>> action)</pre>
|
|
<div class="block">Perform the given action on each key in this map. For each key in this
|
|
map in an unspecified order, the given <TT>action</TT>'s <TT>run()</TT>
|
|
method is called, passing in the key. The state of the key must not be
|
|
altered.
|
|
<P>
|
|
<B><I>Warning:</I></B> If the <TT>action</TT> adds mappings to or removes
|
|
mappings from the map, the <TT>forEachKeyDo()</TT> method's behavior is
|
|
unspecified.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>action</code> - Action.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="forEachKeyDo(edu.rit.util.ActionResult)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>forEachKeyDo</h4>
|
|
<pre>public <R> R forEachKeyDo(<a href="../../../edu/rit/util/ActionResult.html" title="interface in edu.rit.util">ActionResult</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,R> action)</pre>
|
|
<div class="block">Perform the given action on each key in this map and return a result. For
|
|
each key in this map in an unspecified order, the given <TT>action</TT>'s
|
|
<TT>run()</TT> method is called, passing in the key. The state of the key
|
|
must not be altered. After all the keys have been processed, the given
|
|
<TT>action</TT>'s <TT>result()</TT> method is called, and its result is
|
|
returned.
|
|
<P>
|
|
<B><I>Warning:</I></B> If the <TT>action</TT> adds mappings to or removes
|
|
mappings from the map, the <TT>forEachKeyDo()</TT> method's behavior is
|
|
unspecified.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>R</code> - Result data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>action</code> - Action.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Result of processing all the mappings.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="removeEachKeyIf(edu.rit.util.Predicate)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>removeEachKeyIf</h4>
|
|
<pre>public void removeEachKeyIf(<a href="../../../edu/rit/util/Predicate.html" title="interface in edu.rit.util">Predicate</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>> predicate)</pre>
|
|
<div class="block">Evaluate the given predicate on, and possibly remove, each key in this
|
|
map. For each key in this map in an unspecified order, the given
|
|
<TT>predicate</TT>'s <TT>test()</TT> method is called, passing in the
|
|
key. The state of the key must not be altered. If the <TT>test()</TT>
|
|
method returns true, the key and its associated value are removed from
|
|
this map.
|
|
<P>
|
|
<B><I>Warning:</I></B> If the <TT>predicate</TT> adds mappings to or
|
|
removes mappings from the map, other than by returning true, the
|
|
<TT>removeEachKeyIf()</TT> method's behavior is unspecified.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>predicate</code> - Predicate.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="forEachValueDo(edu.rit.util.Action)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>forEachValueDo</h4>
|
|
<pre>public void forEachValueDo(<a href="../../../edu/rit/util/Action.html" title="interface in edu.rit.util">Action</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>> action)</pre>
|
|
<div class="block">Perform the given action on each value in this map. For each value in
|
|
this map in an unspecified order, the given <TT>action</TT>'s
|
|
<TT>run()</TT> method is called, passing in the value. The state of the
|
|
value may be altered; such changes are reflected in this map.
|
|
<P>
|
|
<B><I>Warning:</I></B> If the <TT>action</TT> adds mappings to or removes
|
|
mappings from the map, the <TT>forEachValue()</TT> method's behavior is
|
|
unspecified.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>action</code> - Action.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="forEachValueDo(edu.rit.util.ActionResult)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>forEachValueDo</h4>
|
|
<pre>public <R> R forEachValueDo(<a href="../../../edu/rit/util/ActionResult.html" title="interface in edu.rit.util">ActionResult</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>,R> action)</pre>
|
|
<div class="block">Perform the given action on each value in this map and return a result.
|
|
For each value in this map in an unspecified order, the given
|
|
<TT>action</TT>'s <TT>run()</TT> method is called, passing in the value.
|
|
The state of the value may be altered; such changes are reflected in this
|
|
map. After all the values have been processed, the given
|
|
<TT>action</TT>'s <TT>result()</TT> method is called, and its result is
|
|
returned.
|
|
<P>
|
|
<B><I>Warning:</I></B> If the <TT>action</TT> adds mappings to or removes
|
|
mappings from the map, the <TT>forEachValueDo()</TT> method's behavior is
|
|
unspecified.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>R</code> - Result data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>action</code> - Action.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Result of processing all the mappings.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="removeEachValueIf(edu.rit.util.Predicate)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>removeEachValueIf</h4>
|
|
<pre>public void removeEachValueIf(<a href="../../../edu/rit/util/Predicate.html" title="interface in edu.rit.util">Predicate</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>> predicate)</pre>
|
|
<div class="block">Evaluate the given predicate on, and possibly remove, each value in this
|
|
map. For each value in this map in an unspecified order, the given
|
|
<TT>predicate</TT>'s <TT>test()</TT> method is called, passing in the
|
|
value. The state of the value may be altered; such changes are reflected
|
|
in this map. If the <TT>test()</TT> method returns true, the value and
|
|
its associated key are removed from this map.
|
|
<P>
|
|
<B><I>Warning:</I></B> If the <TT>predicate</TT> adds mappings to or
|
|
removes mappings from the map, other than by returning true, the
|
|
<TT>removeEachValueIf()</TT> method's behavior is unspecified.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>predicate</code> - Predicate.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="toArray(edu.rit.util.Pair[])">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>toArray</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>[] toArray(<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>[] array)</pre>
|
|
<div class="block">Store this map's key-value mappings in the given array. The mappings are
|
|
stored in an unspecified order. The first mapping is stored at index 0,
|
|
the second mapping at index 1, and so on. The number of array elements
|
|
stored is <TT>array.length</TT>. If this map contains fewer than
|
|
<TT>array.length</TT> mappings, the remaining array elements are set to
|
|
null.
|
|
<P>
|
|
The <TT>toArray()</TT> method stores <I>references</I> to this map's
|
|
mappings in the given array. The states of the keys stored in the array
|
|
must not be altered. The states of the values stored in the array may be
|
|
altered, and the values stored in the array may be replaced by different
|
|
objects; such changes are reflected in this map.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>array</code> - Array in which to store mappings.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>The given array is returned.</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>array</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="toArray(edu.rit.util.Pair[], int, int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>toArray</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>[] toArray(<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>>[] array,
|
|
int off,
|
|
int len)</pre>
|
|
<div class="block">Store this map's key-value mappings in a portion of the given array. The
|
|
mappings are stored in an unspecified order. The first mapping is stored
|
|
at index <TT>off</TT>, the second mapping at index <TT>off</TT>+1, and so
|
|
on. The number of array elements stored is <TT>len</TT>. If this map
|
|
contains fewer than <TT>len</TT> mappings, the remaining array elements
|
|
are set to null.
|
|
<P>
|
|
The <TT>toArray()</TT> method stores <I>references</I> to this map's
|
|
mappings in the given array. The states of the keys stored in the array
|
|
must not be altered. The states of the values stored in the array may be
|
|
altered, and the values stored in the array may be replaced by different
|
|
objects; such changes are reflected in this map.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>array</code> - Array in which to store mappings.</dd><dd><code>off</code> - Index at which to store first mapping.</dd><dd><code>len</code> - Number of mappings to store.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>The given array is returned.</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>array</TT> is null.</dd>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off</TT>+<TT>len</TT> > <TT>array.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="keysToArray(java.lang.Object[])">
|
|
<!-- -->
|
|
</a><a name="keysToArray(K[])">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>keysToArray</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>[] keysToArray(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>[] array)</pre>
|
|
<div class="block">Store this map's keys in the given array. The keys are stored in an
|
|
unspecified order. The first key is stored at index 0, the second key at
|
|
index 1, and so on. The number of array elements stored is
|
|
<TT>array.length</TT>. If this map contains fewer than
|
|
<TT>array.length</TT> mappings, the remaining array elements are set to
|
|
null.
|
|
<P>
|
|
The <TT>keysToArray()</TT> method stores <I>references</I> to this map's
|
|
keys in the given array. The states of the keys stored in the array must
|
|
not be altered.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>array</code> - Array in which to store keys.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>The given array is returned.</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>array</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="keysToArray(java.lang.Object[],int,int)">
|
|
<!-- -->
|
|
</a><a name="keysToArray(K[], int, int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>keysToArray</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>[] keysToArray(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>[] array,
|
|
int off,
|
|
int len)</pre>
|
|
<div class="block">Store this map's keys in a portion of the given array. The keys are
|
|
stored in an unspecified order. The first key is stored at index
|
|
<TT>off</TT>, the second key at index <TT>off</TT>+1, and so on. The
|
|
number of array elements stored is <TT>len</TT>. If this map contains
|
|
fewer than <TT>len</TT> mappings, the remaining array elements are set to
|
|
null.
|
|
<P>
|
|
The <TT>keysToArray()</TT> method stores <I>references</I> to this map's
|
|
keys in the given array. The states of the keys stored in the array must
|
|
not be altered.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>array</code> - Array in which to store keys.</dd><dd><code>off</code> - Index at which to store first key.</dd><dd><code>len</code> - Number of keys to store.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>The given array is returned.</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>array</TT> is null.</dd>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off</TT>+<TT>len</TT> > <TT>array.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="valuesToArray(java.lang.Object[])">
|
|
<!-- -->
|
|
</a><a name="valuesToArray(V[])">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>valuesToArray</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>[] valuesToArray(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>[] array)</pre>
|
|
<div class="block">Store this map's values in the given array. The values are stored in an
|
|
unspecified order. The first value is stored at index 0, the second value
|
|
at index 1, and so on. The number of array elements stored is
|
|
<TT>array.length</TT>. If this map contains fewer than
|
|
<TT>array.length</TT> mappings, the remaining array elements are set to
|
|
null.
|
|
<P>
|
|
The <TT>valuesToArray()</TT> method stores <I>references</I> to this
|
|
map's values in the given array. The states of the values stored in the
|
|
array may be altered; such changes are reflected in this map.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>array</code> - Array in which to store values.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>The given array is returned.</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>array</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="valuesToArray(java.lang.Object[],int,int)">
|
|
<!-- -->
|
|
</a><a name="valuesToArray(V[], int, int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>valuesToArray</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>[] valuesToArray(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>[] array,
|
|
int off,
|
|
int len)</pre>
|
|
<div class="block">Store this map's values in a portion of the given array. The values are
|
|
stored in an unspecified order. The first value is stored at index
|
|
<TT>off</TT>, the second value at index <TT>off</TT>+1, and so on. The
|
|
number of array elements stored is <TT>len</TT>. If this map contains
|
|
fewer than <TT>len</TT> mappings, the remaining array elements are set to
|
|
null.
|
|
<P>
|
|
The <TT>valuesToArray()</TT> method stores <I>references</I> to this
|
|
map's values in the given array. The states of the values stored in the
|
|
array may be altered; such changes are reflected in this map.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>array</code> - Array in which to store values.</dd><dd><code>off</code> - Index at which to store first value.</dd><dd><code>len</code> - Number of values to store.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>The given array is returned.</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>array</TT> is null.</dd>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>off</TT> < 0, <TT>len</TT>
|
|
< 0, or <TT>off</TT>+<TT>len</TT> > <TT>array.length</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="writeOut(edu.rit.io.OutStream)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>writeOut</h4>
|
|
<pre>public void writeOut(<a href="../../../edu/rit/io/OutStream.html" title="class in edu.rit.io">OutStream</a> out)
|
|
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
|
|
<div class="block">Write this object's fields to the given out stream. Each key-value
|
|
mapping, an instance of type <a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a>, is written using
|
|
<a href="../../../edu/rit/io/OutStream.html#writeObject(java.lang.Object)"><code>writeObject()</code></a>.</div>
|
|
<dl>
|
|
<dt><strong>Specified by:</strong></dt>
|
|
<dd><code><a href="../../../edu/rit/io/Streamable.html#writeOut(edu.rit.io.OutStream)">writeOut</a></code> in interface <code><a href="../../../edu/rit/io/Streamable.html" title="interface in edu.rit.io">Streamable</a></code></dd>
|
|
<dt><span class="strong">Parameters:</span></dt><dd><code>out</code> - Out stream.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - Thrown if a key or value in this set is not streamable or
|
|
serializable. Thrown if an I/O error occurred.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="readIn(edu.rit.io.InStream)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>readIn</h4>
|
|
<pre>public void readIn(<a href="../../../edu/rit/io/InStream.html" title="class in edu.rit.io">InStream</a> in)
|
|
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
|
|
<div class="block">Read this object's fields from the given in stream. Each key-value
|
|
mapping, an instance of type <a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a>, is read using <a href="../../../edu/rit/io/InStream.html#readObject()"><code>readObject()</code></a>.</div>
|
|
<dl>
|
|
<dt><strong>Specified by:</strong></dt>
|
|
<dd><code><a href="../../../edu/rit/io/Streamable.html#readIn(edu.rit.io.InStream)">readIn</a></code> in interface <code><a href="../../../edu/rit/io/Streamable.html" title="interface in edu.rit.io">Streamable</a></code></dd>
|
|
<dt><span class="strong">Parameters:</span></dt><dd><code>in</code> - In stream.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - Thrown if an I/O error occurred.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getPair(java.lang.Object,java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="getPair(K, V)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getPair</h4>
|
|
<pre>protected <a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a>,<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a>> getPair(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key,
|
|
<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> value)</pre>
|
|
<div class="block">Create a pair containing the given key and value. Whenever class Map
|
|
needs to create a pair, it does so by calling this method.
|
|
<P>
|
|
The <TT>getPair()</TT> method in class Map returns an instance of class
|
|
<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><K,V>. The given key is copied using the
|
|
<a href="../../../edu/rit/util/Map.html#copyKey(K)"><code>copyKey()</code></a> method. The given value is copied
|
|
using the <a href="../../../edu/rit/util/Map.html#copyValue(V)"><code>copyValue()</code></a> method. A subclass of
|
|
class Map can override the <TT>getPair()</TT> method to return something
|
|
else. Possibilities include:
|
|
<UL>
|
|
<P><LI>
|
|
Return an instance of a subclass of class <a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util"><code>Pair</code></a><K,V>,
|
|
in which the <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"><code>equals()</code></a> and <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"><code>hashCode()</code></a> methods have been overridden to implement a
|
|
different pair equality criterion.
|
|
<P><LI>
|
|
Return an instance of a subclass of class <a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util"><code>Pair</code></a><K,V>,
|
|
in which the <a href="../../../edu/rit/io/Streamable.html#writeOut(edu.rit.io.OutStream)"><code>writeOut()</code></a> and <a href="../../../edu/rit/io/Streamable.html#readIn(edu.rit.io.InStream)"><code>readIn()</code></a> methods have been overridden to
|
|
implement different streaming behavior.
|
|
</UL></div>
|
|
<dl><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>
|
|
<a name="copyKey(java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="copyKey(K)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>copyKey</h4>
|
|
<pre>protected <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> copyKey(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">K</a> key)</pre>
|
|
<div class="block">Copy the given key. The <TT>copyKey()</TT> method in class Map merely
|
|
returns the <TT>key</TT> reference; this makes a <I>shallow copy.</I> A
|
|
subclass of class Map can override the <TT>copyKey()</TT> method to
|
|
return something else. Possibilities include:
|
|
<UL>
|
|
<P><LI>
|
|
Return a clone of the key, which makes a <I>deep copy.</I>
|
|
<P><LI>
|
|
Return an instance of a subclass of the key's class, in which the
|
|
<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"><code>equals()</code></a> and <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"><code>hashCode()</code></a> methods have been overridden to implement a different key
|
|
equality criterion.
|
|
<P><LI>
|
|
Return an instance of a subclass of the key's class, in which the
|
|
<a href="../../../edu/rit/io/Streamable.html#writeOut(edu.rit.io.OutStream)"><code>writeOut()</code></a> and <a href="../../../edu/rit/io/Streamable.html#readIn(edu.rit.io.InStream)"><code>readIn()</code></a> methods have been overridden to
|
|
implement different streaming behavior.
|
|
</UL></div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key to copy.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Copy of <TT>key</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="copyValue(java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="copyValue(V)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>copyValue</h4>
|
|
<pre>protected <a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> copyValue(<a href="../../../edu/rit/util/Map.html" title="type parameter in Map">V</a> value)</pre>
|
|
<div class="block">Copy the given value. The <TT>copyValue()</TT> method in class Map merely
|
|
returns the <TT>value</TT> reference; this makes a <I>shallow copy.</I> A
|
|
subclass of class Map can override the <TT>copyValue()</TT> method to
|
|
return something else. Possibilities include:
|
|
<UL>
|
|
<P><LI>
|
|
Return a clone of the value, which makes a <I>deep copy.</I>
|
|
<P><LI>
|
|
Return an instance of a subclass of the value's class, in which the
|
|
<a href="../../../edu/rit/io/Streamable.html#writeOut(edu.rit.io.OutStream)"><code>writeOut()</code></a> and <a href="../../../edu/rit/io/Streamable.html#readIn(edu.rit.io.InStream)"><code>readIn()</code></a> methods have been overridden to
|
|
implement different streaming behavior.
|
|
</UL></div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - Value to copy.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Copy of <TT>value</TT>.</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/Map.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/LongPredicate.html" title="interface in edu.rit.util"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../edu/rit/util/MultiSet.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/Map.html" target="_top">Frames</a></li>
|
|
<li><a href="Map.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: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_summary">Constr</a> | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_detail">Constr</a> | </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 © 2013–2016 by Alan Kaminsky. All rights reserved. Send comments to ark</FONT><FONT SIZE="1" COLOR="#FFFFFF">­</FONT><FONT SIZE="-2">@</FONT><FONT SIZE="1" COLOR="#FFFFFF">­</FONT><FONT SIZE="-2">cs.rit.edu.</FONT></small></p>
|
|
</body>
|
|
</html>
|