PageRenderTime 32ms CodeModel.GetById 11ms app.highlight 16ms RepoModel.GetById 1ms app.codeStats 0ms

/as3/docs/org/wiiflash/utils/HistoryPeakDetection.html

http://wiiflash.googlecode.com/
HTML | 448 lines | 422 code | 17 blank | 9 comment | 0 complexity | fa65398b1d856588ee387797b420d9e1 MD5 | raw file
  1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2<html>
  3<head>
  4<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
  6<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
  7<meta content="HistoryPeakDetection,org.wiiflash.utils.HistoryPeakDetection,addValue,toString,addEventListener,dispatchEvent,hasEventListener,removeEventListener,willTrigger" name="keywords">
  8<title>org.wiiflash.utils.HistoryPeakDetection</title>
  9</head>
 10<body>
 11<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
 12<!--
 13				asdocTitle = 'HistoryPeakDetection - WiiFlash API Documentation';
 14				var baseRef = '../../../';
 15				window.onload = configPage;
 16			--></script>
 17<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
 18<tr>
 19<td align="left" class="titleTableTitle">WiiFlash API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?org/wiiflash/utils/HistoryPeakDetection.html&amp;org/wiiflash/utils/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
 20</tr>
 21<tr class="titleTableRow2">
 22<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;HistoryPeakDetection</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a>&nbsp;| <a href="#eventSummary">Events</a></td>
 23</tr>
 24<tr class="titleTableRow3">
 25<td colspan="2">&nbsp;</td>
 26</tr>
 27</table>
 28<script type="text/javascript" language="javascript">
 29<!--
 30if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class HistoryPeakDetection"); titleBar_setSubNav(false,false,false,false,true,false,true,false,false,false,false,false,false,false);}
 31--></script>
 32<div class="MainContent">
 33<table cellspacing="0" cellpadding="0" class="classHeaderTable">
 34<tr>
 35<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">org.wiiflash.utils</a></td>
 36</tr>
 37<tr>
 38<td class="classHeaderTableLabel">Class</td><td class="classSignature">public final  class HistoryPeakDetection</td>
 39</tr>
 40<tr>
 41<td class="classHeaderTableLabel">Implements</td><td>flash.events.IEventDispatcher</td>
 42</tr>
 43</table>
 44<p></p>
 45  The HistoryPeakDetection class is analyzing a set of values to detect peaks inside.
 46  
 47  A peak is detected if current value is greater than average value of history values
 48  multiplied by given <code>historyMultiplier</code>.
 49  
 50  Also the current value can be interpolated using <code>valueCount</code> greater than
 51  one. If this is the case the current value is the average of given values. This average
 52  value will be put into the history afterwards.
 53  
 54  <p></p>
 55<br>
 56<hr>
 57</div>
 58<a name="methodSummary"></a>
 59<div class="summarySection">
 60<div class="summaryTableTitle">Public Methods</div>
 61<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
 62<tr>
 63<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
 64</tr>
 65<tr class="">
 66<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
 67<div class="summarySignature">
 68<a class="signatureLink" href="#HistoryPeakDetection()">HistoryPeakDetection</a>(valueCount:int = 2, historyCount:int = 32, historyMultiplier:Number = 2)</div>
 69<div class="summaryTableDescription">
 70   Creates a new HistoryPeakDetection object.</div>
 71</td><td class="summaryTableOwnerCol">HistoryPeakDetection</td>
 72</tr>
 73<tr class="">
 74<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
 75<div class="summarySignature">
 76<a class="signatureLink" href="#addEventListener()">addEventListener</a>(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void</div>
 77<div class="summaryTableDescription">
 78   Registers an event listener object with a HistoryPeakDetection object so that the listener receives notification of an event.</div>
 79</td><td class="summaryTableOwnerCol">HistoryPeakDetection</td>
 80</tr>
 81<tr class="">
 82<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
 83<div class="summarySignature">
 84<a class="signatureLink" href="#addValue()">addValue</a>(value:Number):Boolean</div>
 85<div class="summaryTableDescription">
 86   Adds a value to the HistoryPeakDetection object.</div>
 87</td><td class="summaryTableOwnerCol">HistoryPeakDetection</td>
 88</tr>
 89<tr class="">
 90<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
 91<div class="summarySignature">
 92<a class="signatureLink" href="#dispatchEvent()">dispatchEvent</a>(event:Event):Boolean</div>
 93<div class="summaryTableDescription">
 94   Dispatches an event into the event flow.</div>
 95</td><td class="summaryTableOwnerCol">HistoryPeakDetection</td>
 96</tr>
 97<tr class="">
 98<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
 99<div class="summarySignature">
100<a class="signatureLink" href="#hasEventListener()">hasEventListener</a>(type:String):Boolean</div>
101<div class="summaryTableDescription">
102   Checks whether the HistoryPeakDetection object has any listeners registered for a specific type of event.</div>
103</td><td class="summaryTableOwnerCol">HistoryPeakDetection</td>
104</tr>
105<tr class="">
106<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
107<div class="summarySignature">
108<a class="signatureLink" href="#removeEventListener()">removeEventListener</a>(type:String, listener:Function, useCapture:Boolean = false):void</div>
109<div class="summaryTableDescription">
110   Removes a listener from the HistoryPeakDetection object.</div>
111</td><td class="summaryTableOwnerCol">HistoryPeakDetection</td>
112</tr>
113<tr class="">
114<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
115<div class="summarySignature">
116<a class="signatureLink" href="#toString()">toString</a>():String</div>
117<div class="summaryTableDescription">
118   Returns the string representation of the specified object.</div>
119</td><td class="summaryTableOwnerCol">HistoryPeakDetection</td>
120</tr>
121<tr class="">
122<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
123<div class="summarySignature">
124<a class="signatureLink" href="#willTrigger()">willTrigger</a>(type:String):Boolean</div>
125<div class="summaryTableDescription">
126   Checks whether an event listener is registered with this HistoryPeakDetection object or any of its ancestors for the specified event type.</div>
127</td><td class="summaryTableOwnerCol">HistoryPeakDetection</td>
128</tr>
129</table>
130</div>
131<a name="eventSummary"></a>
132<div class="summarySection">
133<div class="summaryTableTitle">Events</div>
134<table id="summaryTableEvent" class="summaryTable " cellpadding="3" cellspacing="0">
135<tr>
136<th>&nbsp;</th><th colspan="2">Event</th><th>Summary</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
137</tr>
138<tr class="">
139<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
140<div class="summarySignature">
141<a class="signatureLink" href="#event:peak">peak</a>
142</div>
143</td><td class="summaryTableDescription summaryTableCol">
144  Dispatched when a peak has been detected.</td><td class="summaryTableOwnerCol">HistoryPeakDetection</td>
145</tr>
146</table>
147</div>
148<script type="text/javascript" language="javascript">
149<!--
150showHideInherited();
151--></script>
152<div class="MainContent">
153<a name="constructorDetail"></a>
154<div class="detailSectionHeader">Constructor detail</div>
155<a name="HistoryPeakDetection()"></a>
156<table cellspacing="0" cellpadding="0" class="detailHeader">
157<tr>
158<td class="detailHeaderName">HistoryPeakDetection</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
159</tr>
160</table>
161<div class="detailBody">
162<code>public function HistoryPeakDetection(valueCount:int = 2, historyCount:int = 32, historyMultiplier:Number = 2)</code><p>
163   Creates a new HistoryPeakDetection object.
164   
165   </p><span class="label">Parameters</span>
166<table border="0" cellspacing="0" cellpadding="0">
167<tr>
168<td width="20px"></td><td><code><span class="label">valueCount</span>:int</code> (default = <code>2</code>)<code></code> &mdash; Number of values that build current value.
169   </td>
170</tr>
171<tr>
172<td class="paramSpacer">&nbsp;</td>
173</tr>
174<tr>
175<td width="20px"></td><td><code><span class="label">historyCount</span>:int</code> (default = <code>32</code>)<code></code> &mdash; Number of values that are stored in the history.
176   </td>
177</tr>
178<tr>
179<td class="paramSpacer">&nbsp;</td>
180</tr>
181<tr>
182<td width="20px"></td><td><code><span class="label">historyMultiplier</span>:Number</code> (default = <code>2</code>)<code></code> &mdash; Multiplier for average value of history.
183   </td>
184</tr>
185</table>
186</div>
187<a name="methodDetail"></a>
188<div class="detailSectionHeader">Method detail</div>
189<a name="addEventListener()"></a>
190<table cellspacing="0" cellpadding="0" class="detailHeader">
191<tr>
192<td class="detailHeaderName">addEventListener</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
193</tr>
194</table>
195<div class="detailBody">
196<code>public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void</code><p>
197   Registers an event listener object with a HistoryPeakDetection object so that the listener receives notification of an event.
198   
199   </p><span class="label">Parameters</span>
200<table border="0" cellspacing="0" cellpadding="0">
201<tr>
202<td width="20px"></td><td><code><span class="label">type</span>:String</code> &mdash; The type of event.
203   </td>
204</tr>
205<tr>
206<td class="paramSpacer">&nbsp;</td>
207</tr>
208<tr>
209<td width="20px"></td><td><code><span class="label">listener</span>:Function</code> &mdash; The listener function that processes the event.
210   </td>
211</tr>
212<tr>
213<td class="paramSpacer">&nbsp;</td>
214</tr>
215<tr>
216<td width="20px"></td><td><code><span class="label">useCapture</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; Determines whether the listener works in the capture phase or the target and bubbling phases.
217   </td>
218</tr>
219<tr>
220<td class="paramSpacer">&nbsp;</td>
221</tr>
222<tr>
223<td width="20px"></td><td><code><span class="label">priority</span>:int</code> (default = <code>0</code>)<code></code> &mdash; The priority level of the event listener.
224   </td>
225</tr>
226<tr>
227<td class="paramSpacer">&nbsp;</td>
228</tr>
229<tr>
230<td width="20px"></td><td><code><span class="label">useWeakReference</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; Determines whether the reference to the listener is strong or weak.
231   
232   </td>
233</tr>
234</table>
235<p>
236<span class="label">See also</span>
237</p>
238<div class="seeAlso">
239<a href="http://livedocs.adobe.com/flex/2/langref/flash/events/IEventDispatcher.html#addEventListener()" target="mm_external">flash.events.IEventDispatcher.addEventListener()</a>
240</div>
241</div>
242<a name="addValue()"></a>
243<table cellspacing="0" cellpadding="0" class="detailHeader">
244<tr>
245<td class="detailHeaderName">addValue</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
246</tr>
247</table>
248<div class="detailBody">
249<code>public function addValue(value:Number):Boolean</code><p>
250   Adds a value to the HistoryPeakDetection object.
251   Whenever a value is added the check to detect a peak is done.
252   
253   </p><span class="label">Parameters</span>
254<table border="0" cellspacing="0" cellpadding="0">
255<tr>
256<td width="20px"></td><td><code><span class="label">value</span>:Number</code> &mdash; The new value.
257   </td>
258</tr>
259</table>
260<p></p>
261<span class="label">Returns</span>
262<table border="0" cellspacing="0" cellpadding="0">
263<tr>
264<td width="20"></td><td><code>Boolean</code> &mdash; <code>true</code> if peak has been detected; <code>false</code> otherwise.
265   </td>
266</tr>
267</table>
268</div>
269<a name="dispatchEvent()"></a>
270<table cellspacing="0" cellpadding="0" class="detailHeader">
271<tr>
272<td class="detailHeaderName">dispatchEvent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
273</tr>
274</table>
275<div class="detailBody">
276<code>public function dispatchEvent(event:Event):Boolean</code><p>
277   Dispatches an event into the event flow.
278   
279   </p><span class="label">Parameters</span>
280<table border="0" cellspacing="0" cellpadding="0">
281<tr>
282<td width="20px"></td><td><code><span class="label">event</span>:Event</code> &mdash; The Event object dispatched into the event flow.
283   
284   </td>
285</tr>
286</table>
287<p></p>
288<span class="label">Returns</span>
289<table border="0" cellspacing="0" cellpadding="0">
290<tr>
291<td width="20"></td><td><code>Boolean</code></td>
292</tr>
293</table>
294<p>
295<span class="label">See also</span>
296</p>
297<div class="seeAlso">
298<a href="http://livedocs.adobe.com/flex/2/langref/flash/events/IEventDispatcher.html#dispatchEvent()" target="mm_external">flash.events.IEventDispatcher.dispatchEvent()</a>
299</div>
300</div>
301<a name="hasEventListener()"></a>
302<table cellspacing="0" cellpadding="0" class="detailHeader">
303<tr>
304<td class="detailHeaderName">hasEventListener</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
305</tr>
306</table>
307<div class="detailBody">
308<code>public function hasEventListener(type:String):Boolean</code><p>
309   Checks whether the HistoryPeakDetection object has any listeners registered for a specific type of event.
310   
311   </p><span class="label">Parameters</span>
312<table border="0" cellspacing="0" cellpadding="0">
313<tr>
314<td width="20px"></td><td><code><span class="label">type</span>:String</code> &mdash; The type of event.
315   </td>
316</tr>
317</table>
318<p></p>
319<span class="label">Returns</span>
320<table border="0" cellspacing="0" cellpadding="0">
321<tr>
322<td width="20"></td><td><code>Boolean</code> &mdash; A value of <code>true</code> if a listener of the specified type is registered; <code>false</code> otherwise.
323   
324   </td>
325</tr>
326</table>
327<p>
328<span class="label">See also</span>
329</p>
330<div class="seeAlso">
331<a href="http://livedocs.adobe.com/flex/2/langref/flash/events/IEventDispatcher.html#hasEventListener()" target="mm_external">flash.events.IEventDispatcher.hasEventListener()</a>
332</div>
333</div>
334<a name="removeEventListener()"></a>
335<table cellspacing="0" cellpadding="0" class="detailHeader">
336<tr>
337<td class="detailHeaderName">removeEventListener</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
338</tr>
339</table>
340<div class="detailBody">
341<code>public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void</code><p>
342   Removes a listener from the HistoryPeakDetection object.
343   
344   </p><span class="label">Parameters</span>
345<table border="0" cellspacing="0" cellpadding="0">
346<tr>
347<td width="20px"></td><td><code><span class="label">type</span>:String</code> &mdash; The type of event.
348   </td>
349</tr>
350<tr>
351<td class="paramSpacer">&nbsp;</td>
352</tr>
353<tr>
354<td width="20px"></td><td><code><span class="label">listener</span>:Function</code> &mdash; The listener object to remove.
355   </td>
356</tr>
357<tr>
358<td class="paramSpacer">&nbsp;</td>
359</tr>
360<tr>
361<td width="20px"></td><td><code><span class="label">useCapture</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; Specifies whether the listener was registered for the capture phase or the target and bubbling phases.
362   
363   </td>
364</tr>
365</table>
366<p>
367<span class="label">See also</span>
368</p>
369<div class="seeAlso">
370<a href="http://livedocs.adobe.com/flex/2/langref/flash/events/IEventDispatcher.html#removeEventListener()" target="mm_external">flash.events.IEventDispatcher.removeEventListener()</a>
371</div>
372</div>
373<a name="toString()"></a>
374<table cellspacing="0" cellpadding="0" class="detailHeader">
375<tr>
376<td class="detailHeaderName">toString</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
377</tr>
378</table>
379<div class="detailBody">
380<code>public function toString():String</code><p>
381   Returns the string representation of the specified object.
382   
383   </p><p></p>
384<span class="label">Returns</span>
385<table border="0" cellspacing="0" cellpadding="0">
386<tr>
387<td width="20"></td><td><code>String</code> &mdash; A string representation of the object.  
388   </td>
389</tr>
390</table>
391</div>
392<a name="willTrigger()"></a>
393<table cellspacing="0" cellpadding="0" class="detailHeader">
394<tr>
395<td class="detailHeaderName">willTrigger</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
396</tr>
397</table>
398<div class="detailBody">
399<code>public function willTrigger(type:String):Boolean</code><p>
400   Checks whether an event listener is registered with this HistoryPeakDetection object or any of its ancestors for the specified event type.
401   
402   </p><span class="label">Parameters</span>
403<table border="0" cellspacing="0" cellpadding="0">
404<tr>
405<td width="20px"></td><td><code><span class="label">type</span>:String</code> &mdash; The type of event.
406   </td>
407</tr>
408</table>
409<p></p>
410<span class="label">Returns</span>
411<table border="0" cellspacing="0" cellpadding="0">
412<tr>
413<td width="20"></td><td><code>Boolean</code> &mdash; A value of <code>true</code> if a listener of the specified type will be triggered; <code>false</code> otherwise.
414   
415   </td>
416</tr>
417</table>
418<p>
419<span class="label">See also</span>
420</p>
421<div class="seeAlso">
422<a href="http://livedocs.adobe.com/flex/2/langref/flash/events/IEventDispatcher.html#willTrigger()" target="mm_external">flash.events.IEventDispatcher.willTrigger()</a>
423</div>
424</div>
425<div class="detailSectionHeader">Event detail</div>
426<a name="event:peak"></a>
427<table cellspacing="0" cellpadding="0" class="detailHeader">
428<tr>
429<td class="detailHeaderName">peak</td><td class="detailHeaderType">event&nbsp;</td>
430</tr>
431</table>
432<div class="detailBody">
433<span class="label">Event object type: </span><a href="../events/PeakEvent.html"><code>org.wiiflash.events.PeakEvent</code></a>
434<br>
435<p></p><p>
436  Dispatched when a peak has been detected.
437  
438   </p></div>
439<br>
440<br>
441<hr>
442<br>
443<p></p>
444<center class="copyright">Joa Ebert and Thibault Imbert - http://www.wiiflash.org/<br>Fr Apr 6 2007, 7:14 PM GMT+02:00 </center>
445</div>
446</body>
447</html>
448<!--Joa Ebert and Thibault Imbert - http://www.wiiflash.org/Fr Apr 6 2007, 7:14 PM GMT+02:00 -->