blob: c5f4616fb6c5bbaab2e038c399e8acf23e0ccf97 [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>
<title>ResizableDoubleArray</title>
<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="ResizableDoubleArray";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":9,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":42,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated 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="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/openejb/math/util/MathUtils.html" title="class in org.apache.openejb.math.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/openejb/math/util/ResizableDoubleArray.html" target="_top">Frames</a></li>
<li><a href="ResizableDoubleArray.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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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.openejb.math.util</div>
<h2 title="Class ResizableDoubleArray" class="title">Class ResizableDoubleArray</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.openejb.math.util.ResizableDoubleArray</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, <a href="../../../../../org/apache/openejb/math/util/DoubleArray.html" title="interface in org.apache.openejb.math.util">DoubleArray</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">ResizableDoubleArray</span>
extends java.lang.Object
implements <a href="../../../../../org/apache/openejb/math/util/DoubleArray.html" title="interface in org.apache.openejb.math.util">DoubleArray</a>, java.io.Serializable</pre>
<div class="block"><p>
A variable length <a href="../../../../../org/apache/openejb/math/util/DoubleArray.html" title="interface in org.apache.openejb.math.util"><code>DoubleArray</code></a> implementation that automatically
handles expanding and contracting its internal storage array as elements
are added and removed.
</p>
<p>
The internal storage array starts with capacity determined by the
<code>initialCapacity</code> property, which can be set by the constructor.
The default initial capacity is 16. Adding elements using
<a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#addElement-double-"><code>addElement(double)</code></a> appends elements to the end of the array. When
there are no open entries at the end of the internal storage array, the
array is expanded. The size of the expanded array depends on the
<code>expansionMode</code> and <code>expansionFactor</code> properties.
The <code>expansionMode</code> determines whether the size of the array is
multiplied by the <code>expansionFactor</code> (MULTIPLICATIVE_MODE) or if
the expansion is additive (ADDITIVE_MODE -- <code>expansionFactor</code>
storage locations added). The default <code>expansionMode</code> is
MULTIPLICATIVE_MODE and the default <code>expansionFactor</code>
is 2.0.
</p>
<p>
The <a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#addElementRolling-double-"><code>addElementRolling(double)</code></a> method adds a new element to the end
of the internal storage array and adjusts the "usable window" of the
internal array forward by one position (effectively making what was the
second element the first, and so on). Repeated activations of this method
(or activation of <a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#discardFrontElements-int-"><code>discardFrontElements(int)</code></a>) will effectively orphan
the storage locations at the beginning of the internal storage array. To
reclaim this storage, each time one of these methods is activated, the size
of the internal storage array is compared to the number of addressable
elements (the <code>numElements</code> property) and if the difference
is too large, the internal array is contracted to size
<code>numElements + 1.</code> The determination of when the internal
storage array is "too large" depends on the <code>expansionMode</code> and
<code>contractionFactor</code> properties. If the <code>expansionMode</code>
is <code>MULTIPLICATIVE_MODE</code>, contraction is triggered when the
ratio between storage array length and <code>numElements</code> exceeds
<code>contractionFactor.</code> If the <code>expansionMode</code>
is <code>ADDITIVE_MODE,</code> the number of excess storage locations
is compared to <code>contractionFactor.</code>
</p>
<p>
To avoid cycles of expansions and contractions, the
<code>expansionFactor</code> must not exceed the
<code>contractionFactor.</code> Constructors and mutators for both of these
properties enforce this requirement, throwing IllegalArgumentException if it
is violated.
</p></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../serialized-form.html#org.apache.openejb.math.util.ResizableDoubleArray">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#ADDITIVE_MODE">ADDITIVE_MODE</a></span></code>
<div class="block">additive expansion mode</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#contractionCriteria">contractionCriteria</a></span></code>
<div class="block">The contraction criteria determines when the internal array will be
contracted to fit the number of elements contained in the element
array + 1.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#expansionFactor">expansionFactor</a></span></code>
<div class="block">The expansion factor of the array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#expansionMode">expansionMode</a></span></code>
<div class="block">Determines whether array expansion by <code>expansionFactor</code>
is additive or multiplicative.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#initialCapacity">initialCapacity</a></span></code>
<div class="block">The initial capacity of the array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected double[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#internalArray">internalArray</a></span></code>
<div class="block">The internal storage array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#MULTIPLICATIVE_MODE">MULTIPLICATIVE_MODE</a></span></code>
<div class="block">multiplicative expansion mode</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#numElements">numElements</a></span></code>
<div class="block">The number of addressable elements in the array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#startIndex">startIndex</a></span></code>
<div class="block">The position of the first addressable element in the internal storage
array.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== 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/openejb/math/util/ResizableDoubleArray.html#ResizableDoubleArray--">ResizableDoubleArray</a></span>()</code>
<div class="block">Create a ResizableArray with default properties.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#ResizableDoubleArray-int-">ResizableDoubleArray</a></span>(int&nbsp;initialCapacity)</code>
<div class="block">Create a ResizableArray with the specified initial capacity.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#ResizableDoubleArray-int-float-">ResizableDoubleArray</a></span>(int&nbsp;initialCapacity,
float&nbsp;expansionFactor)</code>
<div class="block">
Create a ResizableArray with the specified initial capacity
and expansion factor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#ResizableDoubleArray-int-float-float-">ResizableDoubleArray</a></span>(int&nbsp;initialCapacity,
float&nbsp;expansionFactor,
float&nbsp;contractionCriteria)</code>
<div class="block">
Create a ResizableArray with the specified initialCapacity,
expansionFactor, and contractionCriteria.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#ResizableDoubleArray-int-float-float-int-">ResizableDoubleArray</a></span>(int&nbsp;initialCapacity,
float&nbsp;expansionFactor,
float&nbsp;contractionCriteria,
int&nbsp;expansionMode)</code>
<div class="block">
Create a ResizableArray with the specified properties.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#ResizableDoubleArray-org.apache.openejb.math.util.ResizableDoubleArray-">ResizableDoubleArray</a></span>(<a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html" title="class in org.apache.openejb.math.util">ResizableDoubleArray</a>&nbsp;original)</code>
<div class="block">Copy constructor.</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="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="t2" class="tableTab"><span><a href="javascript:show(2);">Instance 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><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated 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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#addElement-double-">addElement</a></span>(double&nbsp;value)</code>
<div class="block">Adds an element to the end of this expandable array.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#addElementRolling-double-">addElementRolling</a></span>(double&nbsp;value)</code>
<div class="block">
Adds an element to the end of the array and removes the first
element in the array.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#checkContractExpand-float-float-">checkContractExpand</a></span>(float&nbsp;contraction,
float&nbsp;expansion)</code>
<div class="block">Checks the expansion factor and the contraction criteria and throws an
IllegalArgumentException if the contractionCriteria is less than the
expansionCriteria</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#clear--">clear</a></span>()</code>
<div class="block">Clear the array, reset the size to the initialCapacity and the number
of elements to zero.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#contract--">contract</a></span>()</code>
<div class="block">Contracts the storage array to the (size of the element set) + 1 - to
avoid a zero length array.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html" title="class in org.apache.openejb.math.util">ResizableDoubleArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#copy--">copy</a></span>()</code>
<div class="block">Returns a copy of the ResizableDoubleArray.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#copy-org.apache.openejb.math.util.ResizableDoubleArray-org.apache.openejb.math.util.ResizableDoubleArray-">copy</a></span>(<a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html" title="class in org.apache.openejb.math.util">ResizableDoubleArray</a>&nbsp;source,
<a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html" title="class in org.apache.openejb.math.util">ResizableDoubleArray</a>&nbsp;dest)</code>
<div class="block">Copies source to dest, copying the underlying data, so dest is
a new, independent copy of source.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#discardFrontElements-int-">discardFrontElements</a></span>(int&nbsp;i)</code>
<div class="block">Discards the <code>i<code> initial elements of the array.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#discardMostRecentElements-int-">discardMostRecentElements</a></span>(int&nbsp;i)</code>
<div class="block">Discards the <code>i<code> last elements of the array.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#equals-java.lang.Object-">equals</a></span>(java.lang.Object&nbsp;object)</code>
<div class="block">Returns true iff object is a ResizableDoubleArray with the same properties
as this and an identical internal storage array.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#expand--">expand</a></span>()</code>
<div class="block">Expands the internal storage array using the expansion factor.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getContractionCriteria--">getContractionCriteria</a></span>()</code>
<div class="block">The contraction criteria defines when the internal array will contract
to store only the number of elements in the element array.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getElement-int-">getElement</a></span>(int&nbsp;index)</code>
<div class="block">Returns the element at the specified index</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getElements--">getElements</a></span>()</code>
<div class="block">Returns a double array containing the elements of this
<code>ResizableArray</code>.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getExpansionFactor--">getExpansionFactor</a></span>()</code>
<div class="block">The expansion factor controls the size of a new array when an array
needs to be expanded.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getExpansionMode--">getExpansionMode</a></span>()</code>
<div class="block">The <code>expansionMode</code> determines whether the internal storage
array grows additively (ADDITIVE_MODE) or multiplicatively
(MULTIPLICATIVE_MODE) when it is expanded.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getInternalValues--">getInternalValues</a></span>()</code>
<div class="block">Returns the internal storage array.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getNumElements--">getNumElements</a></span>()</code>
<div class="block">Returns the number of elements currently in the array.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getValues--">getValues</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">replaced by <a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getInternalValues--"><code>getInternalValues()</code></a> as of 2.0</span></div>
</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#hashCode--">hashCode</a></span>()</code>
<div class="block">Returns a hash code consistent with equals.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#setContractionCriteria-float-">setContractionCriteria</a></span>(float&nbsp;contractionCriteria)</code>
<div class="block">Sets the contraction criteria for this ExpandContractDoubleArray.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#setElement-int-double-">setElement</a></span>(int&nbsp;index,
double&nbsp;value)</code>
<div class="block">Sets the element at the specified index.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#setExpansionFactor-float-">setExpansionFactor</a></span>(float&nbsp;expansionFactor)</code>
<div class="block">Sets the expansionFactor.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#setExpansionMode-int-">setExpansionMode</a></span>(int&nbsp;expansionMode)</code>
<div class="block">Sets the <code>expansionMode</code>.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#setInitialCapacity-int-">setInitialCapacity</a></span>(int&nbsp;initialCapacity)</code>
<div class="block">Sets the initial capacity.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#setNumElements-int-">setNumElements</a></span>(int&nbsp;i)</code>
<div class="block">This function allows you to control the number of elements contained
in this array, and can be used to "throw out" the last n values in an
array.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#start--">start</a></span>()</code>
<div class="block">Returns the starting index of the internal array.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#substituteMostRecentElement-double-">substituteMostRecentElement</a></span>(double&nbsp;value)</code>
<div class="block">Substitutes <code>value</code> for the most recently added value.</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.Object</h3>
<code>clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="ADDITIVE_MODE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ADDITIVE_MODE</h4>
<pre>public static final&nbsp;int ADDITIVE_MODE</pre>
<div class="block">additive expansion mode</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.openejb.math.util.ResizableDoubleArray.ADDITIVE_MODE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="MULTIPLICATIVE_MODE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MULTIPLICATIVE_MODE</h4>
<pre>public static final&nbsp;int MULTIPLICATIVE_MODE</pre>
<div class="block">multiplicative expansion mode</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.openejb.math.util.ResizableDoubleArray.MULTIPLICATIVE_MODE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="contractionCriteria">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>contractionCriteria</h4>
<pre>protected&nbsp;float contractionCriteria</pre>
<div class="block">The contraction criteria determines when the internal array will be
contracted to fit the number of elements contained in the element
array + 1.</div>
</li>
</ul>
<a name="expansionFactor">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>expansionFactor</h4>
<pre>protected&nbsp;float expansionFactor</pre>
<div class="block">The expansion factor of the array. When the array needs to be expanded,
the new array size will be
<code>internalArray.length * expansionFactor</code>
if <code>expansionMode</code> is set to MULTIPLICATIVE_MODE, or
<code>internalArray.length + expansionFactor</code> if
<code>expansionMode</code> is set to ADDITIVE_MODE.</div>
</li>
</ul>
<a name="expansionMode">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>expansionMode</h4>
<pre>protected&nbsp;int expansionMode</pre>
<div class="block">Determines whether array expansion by <code>expansionFactor</code>
is additive or multiplicative.</div>
</li>
</ul>
<a name="initialCapacity">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initialCapacity</h4>
<pre>protected&nbsp;int initialCapacity</pre>
<div class="block">The initial capacity of the array. Initial capacity is not exposed as a
property as it is only meaningful when passed to a constructor.</div>
</li>
</ul>
<a name="internalArray">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>internalArray</h4>
<pre>protected&nbsp;double[] internalArray</pre>
<div class="block">The internal storage array.</div>
</li>
</ul>
<a name="numElements">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>numElements</h4>
<pre>protected&nbsp;int numElements</pre>
<div class="block">The number of addressable elements in the array. Note that this
has nothing to do with the length of the internal storage array.</div>
</li>
</ul>
<a name="startIndex">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>startIndex</h4>
<pre>protected&nbsp;int startIndex</pre>
<div class="block">The position of the first addressable element in the internal storage
array. The addressable elements in the array are <code>
internalArray[startIndex],...,internalArray[startIndex + numElements -1]
</code></div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="ResizableDoubleArray--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ResizableDoubleArray</h4>
<pre>public&nbsp;ResizableDoubleArray()</pre>
<div class="block">Create a ResizableArray with default properties.
<ul>
<li><code>initialCapacity = 16</code></li>
<li><code>expansionMode = MULTIPLICATIVE_MODE</code></li>
<li><code>expansionFactor = 2.5</code></li>
<li><code>contractionFactor = 2.0</code></li>
</ul></div>
</li>
</ul>
<a name="ResizableDoubleArray-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ResizableDoubleArray</h4>
<pre>public&nbsp;ResizableDoubleArray(int&nbsp;initialCapacity)</pre>
<div class="block">Create a ResizableArray with the specified initial capacity. Other
properties take default values:
<ul>
<li><code>expansionMode = MULTIPLICATIVE_MODE</code></li>
<li><code>expansionFactor = 2.5</code></li>
<li><code>contractionFactor = 2.0</code></li>
</ul></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>initialCapacity</code> - The initial size of the internal storage array</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if initialCapacity is not > 0</dd>
</dl>
</li>
</ul>
<a name="ResizableDoubleArray-int-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ResizableDoubleArray</h4>
<pre>public&nbsp;ResizableDoubleArray(int&nbsp;initialCapacity,
float&nbsp;expansionFactor)</pre>
<div class="block"><p>
Create a ResizableArray with the specified initial capacity
and expansion factor. The remaining properties take default
values:
<ul>
<li><code>expansionMode = MULTIPLICATIVE_MODE</code></li>
<li><code>contractionFactor = 0.5 + expansionFactor</code></li>
</ul></p>
<p>
Throws IllegalArgumentException if the following conditions are
not met:
<ul>
<li><code>initialCapacity > 0</code></li>
<li><code>expansionFactor > 1</code></li>
</ul></p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>initialCapacity</code> - The initial size of the internal storage array</dd>
<dd><code>expansionFactor</code> - the array will be expanded based on this
parameter</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if parameters are not valid</dd>
</dl>
</li>
</ul>
<a name="ResizableDoubleArray-int-float-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ResizableDoubleArray</h4>
<pre>public&nbsp;ResizableDoubleArray(int&nbsp;initialCapacity,
float&nbsp;expansionFactor,
float&nbsp;contractionCriteria)</pre>
<div class="block"><p>
Create a ResizableArray with the specified initialCapacity,
expansionFactor, and contractionCriteria. The <code>expansionMode</code>
will default to <code>MULTIPLICATIVE_MODE.</code></p>
<p>
Throws IllegalArgumentException if the following conditions are
not met:
<ul>
<li><code>initialCapacity > 0</code></li>
<li><code>expansionFactor > 1</code></li>
<li><code>contractionFactor >= expansionFactor</code></li>
</ul></p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>initialCapacity</code> - The initial size of the internal storage array</dd>
<dd><code>expansionFactor</code> - the array will be expanded based on this
parameter</dd>
<dd><code>contractionCriteria</code> - The contraction Criteria.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if parameters are not valid</dd>
</dl>
</li>
</ul>
<a name="ResizableDoubleArray-int-float-float-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ResizableDoubleArray</h4>
<pre>public&nbsp;ResizableDoubleArray(int&nbsp;initialCapacity,
float&nbsp;expansionFactor,
float&nbsp;contractionCriteria,
int&nbsp;expansionMode)</pre>
<div class="block"><p>
Create a ResizableArray with the specified properties.</p>
<p>
Throws IllegalArgumentException if the following conditions are
not met:
<ul>
<li><code>initialCapacity > 0</code></li>
<li><code>expansionFactor > 1</code></li>
<li><code>contractionFactor >= expansionFactor</code></li>
<li><code>expansionMode in {MULTIPLICATIVE_MODE, ADDITIVE_MODE}</code>
</li>
</ul></p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>initialCapacity</code> - the initial size of the internal storage array</dd>
<dd><code>expansionFactor</code> - the array will be expanded based on this
parameter</dd>
<dd><code>contractionCriteria</code> - the contraction Criteria</dd>
<dd><code>expansionMode</code> - the expansion mode</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if parameters are not valid</dd>
</dl>
</li>
</ul>
<a name="ResizableDoubleArray-org.apache.openejb.math.util.ResizableDoubleArray-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ResizableDoubleArray</h4>
<pre>public&nbsp;ResizableDoubleArray(<a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html" title="class in org.apache.openejb.math.util">ResizableDoubleArray</a>&nbsp;original)</pre>
<div class="block">Copy constructor. Creates a new ResizableDoubleArray that is a deep,
fresh copy of the original. Needs to acquire synchronization lock
on original. Original may not be null; otherwise a NullPointerException
is thrown.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>original</code> - array to copy</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</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="addElement-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addElement</h4>
<pre>public&nbsp;void&nbsp;addElement(double&nbsp;value)</pre>
<div class="block">Adds an element to the end of this expandable array.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html#addElement-double-">addElement</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html" title="interface in org.apache.openejb.math.util">DoubleArray</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - to be added to end of array</dd>
</dl>
</li>
</ul>
<a name="addElementRolling-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addElementRolling</h4>
<pre>public&nbsp;double&nbsp;addElementRolling(double&nbsp;value)</pre>
<div class="block"><p>
Adds an element to the end of the array and removes the first
element in the array. Returns the discarded first element.
The effect is similar to a push operation in a FIFO queue.
<p>
Example: If the array contains the elements 1, 2, 3, 4 (in that order)
and addElementRolling(5) is invoked, the result is an array containing
the entries 2, 3, 4, 5 and the value returned is 1.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html#addElementRolling-double-">addElementRolling</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html" title="interface in org.apache.openejb.math.util">DoubleArray</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - the value to be added to the array</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value which has been discarded or "pushed" out of the array
by this rolling insert</dd>
</dl>
</li>
</ul>
<a name="substituteMostRecentElement-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>substituteMostRecentElement</h4>
<pre>public&nbsp;double&nbsp;substituteMostRecentElement(double&nbsp;value)</pre>
<div class="block">Substitutes <code>value</code> for the most recently added value.
Returns the value that has been replaced. If the array is empty (i.e.
if <a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#numElements"><code>numElements</code></a> is zero), a MathRuntimeException is thrown.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - new value to substitute for the most recently added value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>value that has been replaced in the array</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
</dl>
</li>
</ul>
<a name="checkContractExpand-float-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkContractExpand</h4>
<pre>protected&nbsp;void&nbsp;checkContractExpand(float&nbsp;contraction,
float&nbsp;expansion)</pre>
<div class="block">Checks the expansion factor and the contraction criteria and throws an
IllegalArgumentException if the contractionCriteria is less than the
expansionCriteria</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>expansion</code> - factor to be checked</dd>
<dd><code>contraction</code> - criteria to be checked</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the contractionCriteria is less than
the expansionCriteria.</dd>
</dl>
</li>
</ul>
<a name="clear--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clear</h4>
<pre>public&nbsp;void&nbsp;clear()</pre>
<div class="block">Clear the array, reset the size to the initialCapacity and the number
of elements to zero.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html#clear--">clear</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html" title="interface in org.apache.openejb.math.util">DoubleArray</a></code></dd>
</dl>
</li>
</ul>
<a name="contract--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>contract</h4>
<pre>public&nbsp;void&nbsp;contract()</pre>
<div class="block">Contracts the storage array to the (size of the element set) + 1 - to
avoid a zero length array. This function also resets the startIndex to
zero.</div>
</li>
</ul>
<a name="discardFrontElements-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>discardFrontElements</h4>
<pre>public&nbsp;void&nbsp;discardFrontElements(int&nbsp;i)</pre>
<div class="block">Discards the <code>i<code> initial elements of the array. For example,
if the array contains the elements 1,2,3,4, invoking
<code>discardFrontElements(2)</code> will cause the first two elements
to be discarded, leaving 3,4 in the array. Throws illegalArgumentException
if i exceeds numElements.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>i</code> - the number of elements to discard from the front of the array</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if i is greater than numElements.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
</dl>
</li>
</ul>
<a name="discardMostRecentElements-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>discardMostRecentElements</h4>
<pre>public&nbsp;void&nbsp;discardMostRecentElements(int&nbsp;i)</pre>
<div class="block">Discards the <code>i<code> last elements of the array. For example,
if the array contains the elements 1,2,3,4, invoking
<code>discardMostRecentElements(2)</code> will cause the last two elements
to be discarded, leaving 1,2 in the array. Throws illegalArgumentException
if i exceeds numElements.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>i</code> - the number of elements to discard from the end of the array</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if i is greater than numElements.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
</dl>
</li>
</ul>
<a name="expand--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>expand</h4>
<pre>protected&nbsp;void&nbsp;expand()</pre>
<div class="block">Expands the internal storage array using the expansion factor.
<p>
if <code>expansionMode</code> is set to MULTIPLICATIVE_MODE,
the new array size will be <code>internalArray.length * expansionFactor.</code>
If <code>expansionMode</code> is set to ADDITIVE_MODE, the length
after expansion will be <code>internalArray.length + expansionFactor</code></div>
</li>
</ul>
<a name="getContractionCriteria--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContractionCriteria</h4>
<pre>public&nbsp;float&nbsp;getContractionCriteria()</pre>
<div class="block">The contraction criteria defines when the internal array will contract
to store only the number of elements in the element array.
If the <code>expansionMode</code> is <code>MULTIPLICATIVE_MODE</code>,
contraction is triggered when the ratio between storage array length
and <code>numElements</code> exceeds <code>contractionFactor</code>.
If the <code>expansionMode</code> is <code>ADDITIVE_MODE</code>, the
number of excess storage locations is compared to
<code>contractionFactor.</code></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the contraction criteria used to reclaim memory.</dd>
</dl>
</li>
</ul>
<a name="getElement-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getElement</h4>
<pre>public&nbsp;double&nbsp;getElement(int&nbsp;index)</pre>
<div class="block">Returns the element at the specified index</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html#getElement-int-">getElement</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html" title="interface in org.apache.openejb.math.util">DoubleArray</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index to fetch a value from</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>value stored at the specified index</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.ArrayIndexOutOfBoundsException</code> - if <code>index</code> is less than
zero or is greater than <code>getNumElements() - 1</code>.</dd>
</dl>
</li>
</ul>
<a name="getElements--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getElements</h4>
<pre>public&nbsp;double[]&nbsp;getElements()</pre>
<div class="block">Returns a double array containing the elements of this
<code>ResizableArray</code>. This method returns a copy, not a
reference to the underlying array, so that changes made to the returned
array have no effect on this <code>ResizableArray.</code></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html#getElements--">getElements</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html" title="interface in org.apache.openejb.math.util">DoubleArray</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the double array.</dd>
</dl>
</li>
</ul>
<a name="getExpansionFactor--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExpansionFactor</h4>
<pre>public&nbsp;float&nbsp;getExpansionFactor()</pre>
<div class="block">The expansion factor controls the size of a new array when an array
needs to be expanded. The <code>expansionMode</code>
determines whether the size of the array is multiplied by the
<code>expansionFactor</code> (MULTIPLICATIVE_MODE) or if
the expansion is additive (ADDITIVE_MODE -- <code>expansionFactor</code>
storage locations added). The default <code>expansionMode</code> is
MULTIPLICATIVE_MODE and the default <code>expansionFactor</code>
is 2.0.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the expansion factor of this expandable double array</dd>
</dl>
</li>
</ul>
<a name="getExpansionMode--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExpansionMode</h4>
<pre>public&nbsp;int&nbsp;getExpansionMode()</pre>
<div class="block">The <code>expansionMode</code> determines whether the internal storage
array grows additively (ADDITIVE_MODE) or multiplicatively
(MULTIPLICATIVE_MODE) when it is expanded.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns the expansionMode.</dd>
</dl>
</li>
</ul>
<a name="getNumElements--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumElements</h4>
<pre>public&nbsp;int&nbsp;getNumElements()</pre>
<div class="block">Returns the number of elements currently in the array. Please note
that this is different from the length of the internal storage array.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html#getNumElements--">getNumElements</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html" title="interface in org.apache.openejb.math.util">DoubleArray</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>number of elements</dd>
</dl>
</li>
</ul>
<a name="getValues--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValues</h4>
<pre>@Deprecated
public&nbsp;double[]&nbsp;getValues()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">replaced by <a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getInternalValues--"><code>getInternalValues()</code></a> as of 2.0</span></div>
<div class="block">Returns the internal storage array. Note that this method returns
a reference to the internal storage array, not a copy, and to correctly
address elements of the array, the <code>startIndex</code> is
required (available via the <a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#start--"><code>start()</code></a> method). This method should
only be used in cases where copying the internal array is not practical.
The <a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getElements--"><code>getElements()</code></a> method should be used in all other cases.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the internal storage array used by this object</dd>
</dl>
</li>
</ul>
<a name="getInternalValues--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInternalValues</h4>
<pre>public&nbsp;double[]&nbsp;getInternalValues()</pre>
<div class="block">Returns the internal storage array. Note that this method returns
a reference to the internal storage array, not a copy, and to correctly
address elements of the array, the <code>startIndex</code> is
required (available via the <a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#start--"><code>start()</code></a> method). This method should
only be used in cases where copying the internal array is not practical.
The <a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html#getElements--"><code>getElements()</code></a> method should be used in all other cases.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the internal storage array used by this object</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
</dl>
</li>
</ul>
<a name="setContractionCriteria-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setContractionCriteria</h4>
<pre>public&nbsp;void&nbsp;setContractionCriteria(float&nbsp;contractionCriteria)</pre>
<div class="block">Sets the contraction criteria for this ExpandContractDoubleArray.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>contractionCriteria</code> - contraction criteria</dd>
</dl>
</li>
</ul>
<a name="setElement-int-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setElement</h4>
<pre>public&nbsp;void&nbsp;setElement(int&nbsp;index,
double&nbsp;value)</pre>
<div class="block">Sets the element at the specified index. If the specified index is greater than
<code>getNumElements() - 1</code>, the <code>numElements</code> property
is increased to <code>index +1</code> and additional storage is allocated
(if necessary) for the new element and all (uninitialized) elements
between the new element and the previous end of the array).</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html#setElement-int-double-">setElement</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/openejb/math/util/DoubleArray.html" title="interface in org.apache.openejb.math.util">DoubleArray</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index to store a value in</dd>
<dd><code>value</code> - value to store at the specified index</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.ArrayIndexOutOfBoundsException</code> - if <code>index</code> is less than
zero.</dd>
</dl>
</li>
</ul>
<a name="setExpansionFactor-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setExpansionFactor</h4>
<pre>public&nbsp;void&nbsp;setExpansionFactor(float&nbsp;expansionFactor)</pre>
<div class="block">Sets the expansionFactor. Throws IllegalArgumentException if the
the following conditions are not met:
<ul>
<li><code>expansionFactor > 1</code></li>
<li><code>contractionFactor >= expansionFactor</code></li>
</ul></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>expansionFactor</code> - the new expansion factor value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if expansionFactor is <= 1 or greater
than contractionFactor</dd>
</dl>
</li>
</ul>
<a name="setExpansionMode-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setExpansionMode</h4>
<pre>public&nbsp;void&nbsp;setExpansionMode(int&nbsp;expansionMode)</pre>
<div class="block">Sets the <code>expansionMode</code>. The specified value must be one of
ADDITIVE_MODE, MULTIPLICATIVE_MODE.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>expansionMode</code> - The expansionMode to set.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the specified mode value is not valid</dd>
</dl>
</li>
</ul>
<a name="setInitialCapacity-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setInitialCapacity</h4>
<pre>protected&nbsp;void&nbsp;setInitialCapacity(int&nbsp;initialCapacity)</pre>
<div class="block">Sets the initial capacity. Should only be invoked by constructors.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>initialCapacity</code> - of the array</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if <code>initialCapacity</code> is not
positive.</dd>
</dl>
</li>
</ul>
<a name="setNumElements-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setNumElements</h4>
<pre>public&nbsp;void&nbsp;setNumElements(int&nbsp;i)</pre>
<div class="block">This function allows you to control the number of elements contained
in this array, and can be used to "throw out" the last n values in an
array. This function will also expand the internal array as needed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>i</code> - a new number of elements</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if <code>i</code> is negative.</dd>
</dl>
</li>
</ul>
<a name="start--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>start</h4>
<pre>public&nbsp;int&nbsp;start()</pre>
<div class="block">Returns the starting index of the internal array. The starting index is
the position of the first addressable element in the internal storage
array. The addressable elements in the array are <code>
internalArray[startIndex],...,internalArray[startIndex + numElements -1]
</code></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>starting index</dd>
</dl>
</li>
</ul>
<a name="copy-org.apache.openejb.math.util.ResizableDoubleArray-org.apache.openejb.math.util.ResizableDoubleArray-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public static&nbsp;void&nbsp;copy(<a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html" title="class in org.apache.openejb.math.util">ResizableDoubleArray</a>&nbsp;source,
<a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html" title="class in org.apache.openejb.math.util">ResizableDoubleArray</a>&nbsp;dest)</pre>
<div class="block"><p>Copies source to dest, copying the underlying data, so dest is
a new, independent copy of source. Does not contract before
the copy.</p>
<p>Obtains synchronization locks on both source and dest
(in that order) before performing the copy.</p>
<p>Neither source nor dest may be null; otherwise a NullPointerException
is thrown</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - ResizableDoubleArray to copy</dd>
<dd><code>dest</code> - ResizableArray to replace with a copy of the source array</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
</dl>
</li>
</ul>
<a name="copy--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/openejb/math/util/ResizableDoubleArray.html" title="class in org.apache.openejb.math.util">ResizableDoubleArray</a>&nbsp;copy()</pre>
<div class="block">Returns a copy of the ResizableDoubleArray. Does not contract before
the copy, so the returned object is an exact copy of this.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new ResizableDoubleArray with the same data and configuration
properties as this</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
</dl>
</li>
</ul>
<a name="equals-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public&nbsp;boolean&nbsp;equals(java.lang.Object&nbsp;object)</pre>
<div class="block">Returns true iff object is a ResizableDoubleArray with the same properties
as this and an identical internal storage array.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>equals</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - object to be compared for equality with this</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff object is a ResizableDoubleArray with the same data and
properties as this</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
</dl>
</li>
</ul>
<a name="hashCode--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>hashCode</h4>
<pre>public&nbsp;int&nbsp;hashCode()</pre>
<div class="block">Returns a hash code consistent with equals.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>hashCode</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>hash code representing this ResizableDoubleArray</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</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="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/openejb/math/util/MathUtils.html" title="class in org.apache.openejb.math.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/openejb/math/util/ResizableDoubleArray.html" target="_top">Frames</a></li>
<li><a href="ResizableDoubleArray.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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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 ======= -->
</body>
</html>