blob: 774479045d8bf6a798a7981f223b068efe9c7007 [file] [log] [blame]
<!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 (1.8.0_112) on Mon Dec 18 11:25:18 EST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Functions (Apache Edgent (incubating) v1.2.0 API)</title>
<meta name="date" content="2017-12-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Functions (Apache Edgent (incubating) v1.2.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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/Functions.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-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/edgent/function/Predicate.html" title="interface in org.apache.edgent.function"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/edgent/function/Functions.html" target="_top">Frames</a></li>
<li><a href="Functions.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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">org.apache.edgent.function</div>
<h2 title="Class Functions" class="title">Class Functions</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/8/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>org.apache.edgent.function.Functions</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">Functions</span>
extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Common functions and functional utilities.</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="memberSummary" 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><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#Functions--">Functions</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Predicate.html" title="interface in org.apache.edgent.function">Predicate</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#alwaysFalse--">alwaysFalse</a></span>()</code>
<div class="block">A Predicate that is always false</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Predicate.html" title="interface in org.apache.edgent.function">Predicate</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#alwaysTrue--">alwaysTrue</a></span>()</code>
<div class="block">A Predicate that is always true</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#closeFunction-java.lang.Object-">closeFunction</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;function)</code>
<div class="block">Close the function.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#delayedConsume-org.apache.edgent.function.Consumer-T-">delayedConsume</a></span>(<a href="../../../../org/apache/edgent/function/Consumer.html" title="interface in org.apache.edgent.function">Consumer</a>&lt;T&gt;&nbsp;consumer,
T&nbsp;value)</code>
<div class="block">Create a <code>Runnable</code> that calls
<code>consumer.accept(value)</code> when <code>run()</code> is called.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Consumer.html" title="interface in org.apache.edgent.function">Consumer</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#discard--">discard</a></span>()</code>
<div class="block">A Consumer that discards all items passed to it.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/UnaryOperator.html" title="interface in org.apache.edgent.function">UnaryOperator</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#identity--">identity</a></span>()</code>
<div class="block">Returns the identity function that returns its single argument.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#isImmutable-java.lang.Object-">isImmutable</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;function)</code>
<div class="block">See if the functional logic is immutable.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#isImmutableClass-java.lang.Class-">isImmutableClass</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;&nbsp;clazz)</code>
<div class="block">See if a function class is immutable.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#runWithFinal-java.lang.Runnable-java.lang.Runnable-">runWithFinal</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;action,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;finalAction)</code>
<div class="block">Wrap a <code>Runnable</code> with a final action that
is always called when <code>action.run()</code> completes.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static &lt;T,U,R&gt;&nbsp;<a href="../../../../org/apache/edgent/function/BiFunction.html" title="interface in org.apache.edgent.function">BiFunction</a>&lt;T,U,R&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#synchronizedBiFunction-org.apache.edgent.function.BiFunction-">synchronizedBiFunction</a></span>(<a href="../../../../org/apache/edgent/function/BiFunction.html" title="interface in org.apache.edgent.function">BiFunction</a>&lt;T,U,R&gt;&nbsp;function)</code>
<div class="block">Return a thread-safe version of a <code>BiFunction</code> function.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Consumer.html" title="interface in org.apache.edgent.function">Consumer</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#synchronizedConsumer-org.apache.edgent.function.Consumer-">synchronizedConsumer</a></span>(<a href="../../../../org/apache/edgent/function/Consumer.html" title="interface in org.apache.edgent.function">Consumer</a>&lt;T&gt;&nbsp;function)</code>
<div class="block">Return a thread-safe version of a <code>Consumer</code> function.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>static &lt;T,R&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,R&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#synchronizedFunction-org.apache.edgent.function.Function-">synchronizedFunction</a></span>(<a href="../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,R&gt;&nbsp;function)</code>
<div class="block">Return a thread-safe version of a <code>Function</code> function.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Supplier.html" title="interface in org.apache.edgent.function">Supplier</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#synchronizedSupplier-org.apache.edgent.function.Supplier-">synchronizedSupplier</a></span>(<a href="../../../../org/apache/edgent/function/Supplier.html" title="interface in org.apache.edgent.function">Supplier</a>&lt;T&gt;&nbsp;function)</code>
<div class="block">Return a thread-safe version of a <code>Supplier</code> function.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#unpartitioned--">unpartitioned</a></span>()</code>
<div class="block">Returns a constant function that returns zero (0).</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/edgent/function/Functions.html#zero--">zero</a></span>()</code>
<div class="block">Returns a constant function that returns zero (0).</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&nbsp;java.lang.<a href="http://docs.oracle.com/javase/8/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/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/8/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/8/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/8/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/8/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/8/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/8/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/8/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/8/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/8/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/8/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="Functions--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Functions</h4>
<pre>public&nbsp;Functions()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="identity--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>identity</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/UnaryOperator.html" title="interface in org.apache.edgent.function">UnaryOperator</a>&lt;T&gt;&nbsp;identity()</pre>
<div class="block">Returns the identity function that returns its single argument.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - tuple type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Identity function that returns its single argument.</dd>
</dl>
</li>
</ul>
<a name="zero--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>zero</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;zero()</pre>
<div class="block">Returns a constant function that returns zero (0).</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - tuple type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Constant function that returns zero (0).</dd>
</dl>
</li>
</ul>
<a name="unpartitioned--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unpartitioned</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;unpartitioned()</pre>
<div class="block">Returns a constant function that returns zero (0).
This is identical to <a href="../../../../org/apache/edgent/function/Functions.html#zero--"><code>zero()</code></a> but is more
readable when applied as a key function.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - tuple type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Constant function that returns zero (0).</dd>
</dl>
</li>
</ul>
<a name="closeFunction-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>closeFunction</h4>
<pre>public static&nbsp;void&nbsp;closeFunction(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;function)
throws <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Close the function.
If <code>function</code> is an instance of <code>AutoCloseable</code>
then close is called, otherwise no action is taken.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>function</code> - Function to be closed.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - Error throwing function.</dd>
</dl>
</li>
</ul>
<a name="synchronizedFunction-org.apache.edgent.function.Function-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>synchronizedFunction</h4>
<pre>public static&nbsp;&lt;T,R&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,R&gt;&nbsp;synchronizedFunction(<a href="../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,R&gt;&nbsp;function)</pre>
<div class="block">Return a thread-safe version of a <code>Function</code> function.
If the function is guaranteed to be immutable (stateless)
then the function is returned, as it is thread safe,
otherwise a wrapper is returned that grabs synchronization
on <code>function</code> when calling <a href="../../../../org/apache/edgent/function/Function.html#apply-T-"><code>Function.apply(Object)</code></a>.
<BR>
If <code>function</code> implements <code>AutoCloseable</code> then
the function is assumed to be stateful and a thread-safe
version is returned.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - source tuple type</dd>
<dd><code>R</code> - result tuple type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>function</code> - Function to return a thread-safe version of.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A thread-safe function</dd>
</dl>
</li>
</ul>
<a name="synchronizedSupplier-org.apache.edgent.function.Supplier-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>synchronizedSupplier</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Supplier.html" title="interface in org.apache.edgent.function">Supplier</a>&lt;T&gt;&nbsp;synchronizedSupplier(<a href="../../../../org/apache/edgent/function/Supplier.html" title="interface in org.apache.edgent.function">Supplier</a>&lt;T&gt;&nbsp;function)</pre>
<div class="block">Return a thread-safe version of a <code>Supplier</code> function.
If the function is guaranteed to be immutable (stateless)
then the function is returned, as it is thread safe,
otherwise a wrapper is returned that grabs synchronization
on <code>function</code> when calling <a href="../../../../org/apache/edgent/function/Supplier.html#get--"><code>Supplier.get()</code></a>.
<BR>
If <code>function</code> implements <code>AutoCloseable</code> then
the function is assumed to be stateful and a thread-safe
version is returned.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - tuple type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>function</code> - Function to return a thread-safe version of.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A thread-safe function</dd>
</dl>
</li>
</ul>
<a name="synchronizedConsumer-org.apache.edgent.function.Consumer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>synchronizedConsumer</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Consumer.html" title="interface in org.apache.edgent.function">Consumer</a>&lt;T&gt;&nbsp;synchronizedConsumer(<a href="../../../../org/apache/edgent/function/Consumer.html" title="interface in org.apache.edgent.function">Consumer</a>&lt;T&gt;&nbsp;function)</pre>
<div class="block">Return a thread-safe version of a <code>Consumer</code> function.
If the function is guaranteed to be immutable (stateless)
then the function is returned, as it is thread safe,
otherwise a wrapper is returned that grabs synchronization
on <code>function</code> when calling <a href="../../../../org/apache/edgent/function/Consumer.html#accept-T-"><code>Consumer.accept(Object)</code></a>.
<BR>
If <code>function</code> implements <code>AutoCloseable</code> then
the function is assumed to be stateful and a thread-safe
version is returned.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - tuple type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>function</code> - Function to return a thread-safe version of.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A thread-safe function</dd>
</dl>
</li>
</ul>
<a name="synchronizedBiFunction-org.apache.edgent.function.BiFunction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>synchronizedBiFunction</h4>
<pre>public static&nbsp;&lt;T,U,R&gt;&nbsp;<a href="../../../../org/apache/edgent/function/BiFunction.html" title="interface in org.apache.edgent.function">BiFunction</a>&lt;T,U,R&gt;&nbsp;synchronizedBiFunction(<a href="../../../../org/apache/edgent/function/BiFunction.html" title="interface in org.apache.edgent.function">BiFunction</a>&lt;T,U,R&gt;&nbsp;function)</pre>
<div class="block">Return a thread-safe version of a <code>BiFunction</code> function.
If the function is guaranteed to be immutable (stateless)
then the function is returned, as it is thread safe,
otherwise a wrapper is returned that grabs synchronization
on <code>function</code> when calling <a href="../../../../org/apache/edgent/function/BiFunction.html#apply-T-U-"><code>BiFunction.apply(Object, Object)</code></a>.
<BR>
If <code>function</code> implements <code>AutoCloseable</code> then
the function is assumed to be stateful and a thread-safe
version is returned.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Type of function's first argument</dd>
<dd><code>U</code> - Type of function's second argument</dd>
<dd><code>R</code> - Type of function's third argument</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>function</code> - Function to return a thread-safe version of.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A thread-safe function</dd>
</dl>
</li>
</ul>
<a name="isImmutable-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isImmutable</h4>
<pre>public static&nbsp;boolean&nbsp;isImmutable(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;function)</pre>
<div class="block">See if the functional logic is immutable.
Logic is stateful if:
Has a non-final instance field.
Has a final instance field that is not a primitive
or a known immutable object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>function</code> - Function to check</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>True if the function is immutable..</dd>
</dl>
</li>
</ul>
<a name="isImmutableClass-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isImmutableClass</h4>
<pre>public static&nbsp;boolean&nbsp;isImmutableClass(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;&nbsp;clazz)</pre>
<div class="block">See if a function class is immutable.
Logic is stateful if:
Has a non-final instance field.
Has a final instance field that is not a primitive
or a known immutable object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>clazz</code> - Class to check</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>True if the function is immutable..</dd>
</dl>
</li>
</ul>
<a name="delayedConsume-org.apache.edgent.function.Consumer-java.lang.Object-">
<!-- -->
</a><a name="delayedConsume-org.apache.edgent.function.Consumer-T-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>delayedConsume</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;delayedConsume(<a href="../../../../org/apache/edgent/function/Consumer.html" title="interface in org.apache.edgent.function">Consumer</a>&lt;T&gt;&nbsp;consumer,
T&nbsp;value)</pre>
<div class="block">Create a <code>Runnable</code> that calls
<code>consumer.accept(value)</code> when <code>run()</code> is called.
This can be used to delay the execution of the consumer
until some time in the future using an executor service.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - tuple type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>consumer</code> - Function to be applied to <code>value</code>.</dd>
<dd><code>value</code> - Value to be consumed.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>Runnable</code> that invokes <code>consumer.accept(value)</code>.</dd>
</dl>
</li>
</ul>
<a name="runWithFinal-java.lang.Runnable-java.lang.Runnable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>runWithFinal</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;runWithFinal(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;action,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;finalAction)</pre>
<div class="block">Wrap a <code>Runnable</code> with a final action that
is always called when <code>action.run()</code> completes.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>action</code> - Action to be invoked before <code>finalAction</code>.</dd>
<dd><code>finalAction</code> - Action to be invoked after <code>action.run()</code> is called.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>Runnable</code> that invokes <code>action.run()</code> and then <code>finalAction.run()</code></dd>
</dl>
</li>
</ul>
<a name="discard--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>discard</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Consumer.html" title="interface in org.apache.edgent.function">Consumer</a>&lt;T&gt;&nbsp;discard()</pre>
<div class="block">A Consumer that discards all items passed to it.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - tuple type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A Consumer that discards all items passed to it.</dd>
</dl>
</li>
</ul>
<a name="alwaysTrue--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>alwaysTrue</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Predicate.html" title="interface in org.apache.edgent.function">Predicate</a>&lt;T&gt;&nbsp;alwaysTrue()</pre>
<div class="block">A Predicate that is always true</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - tuple type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A Predicate that is always true.</dd>
</dl>
</li>
</ul>
<a name="alwaysFalse--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>alwaysFalse</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../org/apache/edgent/function/Predicate.html" title="interface in org.apache.edgent.function">Predicate</a>&lt;T&gt;&nbsp;alwaysFalse()</pre>
<div class="block">A Predicate that is always false</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - tuple type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A Predicate that is always false.</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>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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/Functions.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-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/edgent/function/Predicate.html" title="interface in org.apache.edgent.function"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/edgent/function/Functions.html" target="_top">Frames</a></li>
<li><a href="Functions.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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>Copyright &#169; 2016&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>