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

474 lines
27 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:06 EDT 2016 -->
<title>Combiner (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="Combiner (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/Combiner.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>Prev Class</li>
<li><a href="../../../edu/rit/pjmr/Customizer.html" title="class in edu.rit.pjmr"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?edu/rit/pjmr/Combiner.html" target="_top">Frames</a></li>
<li><a href="Combiner.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.pjmr</div>
<h2 title="Class Combiner" class="title">Class Combiner&lt;K,V extends <a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>&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.pjmr.Combiner&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; must implement interface <a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>.</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="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</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">Combiner&lt;K,V extends <a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>&gt;</span>
extends <a href="../../../edu/rit/util/Map.html" title="class in edu.rit.util">Map</a>&lt;K,V&gt;
implements <a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a></pre>
<div class="block">Class Combiner provides a combiner in the Parallel Java Map Reduce Framework.
See class <a href="../../../edu/rit/pjmr/PjmrJob.html" title="class in edu.rit.pjmr">PjmrJob</a> for further information about configuring
combiners as part of a PJMR job.
<P>
A combiner is a mapping from keys to values. The key can be any object that
is suitable for use as a key in a hashed data structure. The value must be an
object that implements interface <a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>, which is
the interface for an object that supports reduction. The basic operation is
<a href="../../../edu/rit/pjmr/Combiner.html#add(K, V)"><code>add(key,value)</code></a>; this absorbs the given (key, value)
pair into the combiner by reducing the given value into the value associated
with the given key inside the combiner.
<P>
To be suitable for use as a key in a hashed data structure: (1) The key
object's class must define the <TT>equals()</TT> and <TT>hashCode()</TT>
methods in the proper manner. (2) When an object is used as a key, the state
of the object must not be altered.
<P>
A combiner is itself a <a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>. The <a href="../../../edu/rit/pjmr/Combiner.html#reduce(edu.rit.pj2.Vbl)"><code>reduce()</code></a> method absorbs every (key, value) pair in a given
combiner into this combiner.
<P>
<I>Note:</I> Class Combiner is not multiple thread safe. Any necessary thread
synchronization is handled by the caller.</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/pjmr/Combiner.html#Combiner()">Combiner</a></strong>()</code>
<div class="block">Construct a new combiner.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../edu/rit/pjmr/Combiner.html#Combiner(edu.rit.pjmr.Combiner)">Combiner</a></strong>(<a href="../../../edu/rit/pjmr/Combiner.html" title="class in edu.rit.pjmr">Combiner</a>&lt;<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">K</a>,<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a>&gt;&nbsp;combiner)</code>
<div class="block">Construct a new combiner that is a copy of the given combiner.</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>void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/Combiner.html#add(K, V)">add</a></strong>(<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">K</a>&nbsp;key,
<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a>&nbsp;value)</code>
<div class="block">Add the given (key, value) pair into this combiner.</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/pjmr/Combiner.html#clone()">clone</a></strong>()</code>
<div class="block">Create a clone of this shared variable.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a></code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/Combiner.html#copyValue(V)">copyValue</a></strong>(<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a>&nbsp;value)</code>
<div class="block">Copy the given value.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a></code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/Combiner.html#initialValue(K, V)">initialValue</a></strong>(<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">K</a>&nbsp;key,
<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a>&nbsp;value)</code>
<div class="block">The <a href="../../../edu/rit/pjmr/Combiner.html#add(K, V)"><code>add()</code></a> method calls the
<TT>initialValue()</TT> method when a certain key is being added to this
combiner for the first time.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/Combiner.html#reduce(edu.rit.pj2.Vbl)">reduce</a></strong>(<a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>&nbsp;vbl)</code>
<div class="block">Reduce the given shared variable into this shared variable.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/Combiner.html#set(edu.rit.pj2.Vbl)">set</a></strong>(<a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>&nbsp;vbl)</code>
<div class="block">Set this shared variable to the given shared variable.</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#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#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#getPair(K, V)">getPair</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="Combiner()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Combiner</h4>
<pre>public&nbsp;Combiner()</pre>
<div class="block">Construct a new combiner.</div>
</li>
</ul>
<a name="Combiner(edu.rit.pjmr.Combiner)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Combiner</h4>
<pre>public&nbsp;Combiner(<a href="../../../edu/rit/pjmr/Combiner.html" title="class in edu.rit.pjmr">Combiner</a>&lt;<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">K</a>,<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a>&gt;&nbsp;combiner)</pre>
<div class="block">Construct a new combiner that is a copy of the given combiner. Tthe new
combiner's keys are set to the key references in the given combiner. The
new combiner's values are set to clones of the values in the given
combiner.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>combiner</code> - Combiner to copy.</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="add(java.lang.Object,edu.rit.pj2.Vbl)">
<!-- -->
</a><a name="add(K, V)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;void&nbsp;add(<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">K</a>&nbsp;key,
<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a>&nbsp;value)</pre>
<div class="block">Add the given (key, value) pair into this combiner. If the <TT>key</TT>
does not yet exist in this combiner, a new pair (<TT>key</TT>,
<TT>v</TT>) is first added, where <TT>v</TT> is the value returned by the
<a href="../../../edu/rit/pjmr/Combiner.html#initialValue(K, V)"><code>initialValue()</code></a> method. If the given
<TT>value</TT> is non-null, the <TT>value</TT> is reduced into the value
associated with the <TT>key</TT> inside this combiner (either the
existing value, or the newly created value).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key; must be non-null.</dd><dd><code>value</code> - Value; may be 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. Thrown if
<TT>value</TT> is non-null but the value associated with <TT>key</TT>
inside this combiner is null.</dd></dl>
</li>
</ul>
<a name="clone()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clone</h4>
<pre>public&nbsp;<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>&nbsp;clone()</pre>
<div class="block">Create a clone of this shared variable. The clone contains references to
the keys in this combiner. The clone contains clones of the values in
this combiner.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../edu/rit/pj2/Vbl.html#clone()">clone</a></code>&nbsp;in interface&nbsp;<code><a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a></code></dd>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../edu/rit/util/Map.html#clone()">clone</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/pjmr/Combiner.html" title="type parameter in Combiner">K</a>,<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a> extends <a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>&gt;</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>The cloned object; a combiner.</dd></dl>
</li>
</ul>
<a name="set(edu.rit.pj2.Vbl)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>set</h4>
<pre>public&nbsp;void&nbsp;set(<a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>&nbsp;vbl)</pre>
<div class="block">Set this shared variable to the given shared variable. This combiner's
keys are set to the key references in the given combiner. This combiner's
values are set to clones of the values in the given combiner.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../edu/rit/pj2/Vbl.html#set(edu.rit.pj2.Vbl)">set</a></code>&nbsp;in interface&nbsp;<code><a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>vbl</code> - Shared variable; a combiner.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - (unchecked exception) Thrown if the class of <TT>vbl</TT> is not
compatible with the class of this shared variable.</dd></dl>
</li>
</ul>
<a name="reduce(edu.rit.pj2.Vbl)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reduce</h4>
<pre>public&nbsp;void&nbsp;reduce(<a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>&nbsp;vbl)</pre>
<div class="block">Reduce the given shared variable into this shared variable. The two
combiners are combined together, and the result is stored in this
combiner.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../edu/rit/pj2/Vbl.html#reduce(edu.rit.pj2.Vbl)">reduce</a></code>&nbsp;in interface&nbsp;<code><a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>vbl</code> - Shared variable; a combiner.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - (unchecked exception) Thrown if the class of <TT>vbl</TT> is not
compatible with the class of this shared variable.</dd></dl>
</li>
</ul>
<a name="copyValue(edu.rit.pj2.Vbl)">
<!-- -->
</a><a name="copyValue(V)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copyValue</h4>
<pre>protected&nbsp;<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a>&nbsp;copyValue(<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a>&nbsp;value)</pre>
<div class="block">Copy the given value. The <TT>copyValue()</TT> method in class Combiner
returns a clone of the given value.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../edu/rit/util/Map.html#copyValue(V)">copyValue</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/pjmr/Combiner.html" title="type parameter in Combiner">K</a>,<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a> extends <a href="../../../edu/rit/pj2/Vbl.html" title="interface in edu.rit.pj2">Vbl</a>&gt;</code></dd>
<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>
<a name="initialValue(java.lang.Object,edu.rit.pj2.Vbl)">
<!-- -->
</a><a name="initialValue(K, V)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>initialValue</h4>
<pre>protected&nbsp;<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a>&nbsp;initialValue(<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">K</a>&nbsp;key,
<a href="../../../edu/rit/pjmr/Combiner.html" title="type parameter in Combiner">V</a>&nbsp;value)</pre>
<div class="block">The <a href="../../../edu/rit/pjmr/Combiner.html#add(K, V)"><code>add()</code></a> method calls the
<TT>initialValue()</TT> method when a certain key is being added to this
combiner for the first time. The <TT>initialValue()</TT> method returns a
new object which is the initial value to be associated with the new key.
<P>
The <TT>initialValue()</TT> method in class Combiner does the following.
If <TT>value</TT> is null, null is returned. Otherwise, a new instance of
the <TT>value</TT>'s class is returned; the new instance is created by
the class's no-argument constructor. If this is not the desired behavior,
write a subclass of class Combiner and override the
<TT>initialValue()</TT> method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key that is being added; non-null.</dd><dd><code>value</code> - Value that is being added; may be null.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Initial value to be associated with the <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/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - (unchecked exception) Thrown if the <TT>value</TT>'s class does not
have a no-argument constructor, or if an instance of that class
cannot be created.</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/Combiner.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>Prev Class</li>
<li><a href="../../../edu/rit/pjmr/Customizer.html" title="class in edu.rit.pjmr"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?edu/rit/pjmr/Combiner.html" target="_top">Frames</a></li>
<li><a href="Combiner.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>