<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: Node</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: Node</h1>

    




<section>

<header>
    
        <h2>
            <span class="ancestors"><a href="module-Counter.html">Counter</a>~</span>Node</h2>
        
            <div class="class-description">Class representing a Node of the recursive bitmap tree</div>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    
    <h2>Constructor</h2>
    

    <h4 class="name" id="Node"><span class="type-signature"></span>new Node<span class="signature">(begin, depth)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Creates a Node
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>begin</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>depth</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Counter.js.html">Counter.js</a>, <a href="Counter.js.html#line178">line 178</a>
    </li></ul></dd>
    

    

    

    
</dl>
















    
    </div>

    
        <h3 class="subsection-title">Extends</h3>

        


    <ul>
        <li>BitMapTree</li>
    </ul>


    

    

    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id="allocate"><span class="type-signature"></span>allocate<span class="signature">(counter<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Allocates a counter by allocating the corresponding child
Passes a continuation to the child allocate that will
set the current bitmap if the child bitmap is now all set
It will also lazily create the child if it doesn't already exist
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>counter</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Counter.js.html">Counter.js</a>, <a href="Counter.js.html#line220">line 220</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="deallocate"><span class="type-signature"></span>deallocate<span class="signature">(counter, callback)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Deallocates a counter by deallocating the corresponding child
Passes a continuation to the child deallocate that will
unset the current bitmap if the child bitmap was previously all set
It will also attempt to shrink the tree if the child is the terminal child
and it is all unset
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>counter</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Counter.js.html">Counter.js</a>, <a href="Counter.js.html#line266">line 266</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="popChild"><span class="type-signature"></span>popChild<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    Pops the terminal child node or leaf
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Counter.js.html">Counter.js</a>, <a href="Counter.js.html#line208">line 208</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="setChild"><span class="type-signature"></span>setChild<span class="signature">(index<span class="signature-attributes">nullable</span>, child)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Sets a child node or leaf
If the index is left null, then the child is pushed onto the terminal end
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>index</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>child</code></td>
            

            <td class="type">
            
                
<span class="param-type">Leaf</span>
|

<span class="param-type">Node</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Counter.js.html">Counter.js</a>, <a href="Counter.js.html#line196">line 196</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Counter.html">Counter</a></li></ul><h3>Classes</h3><ul><li><a href="module-Counter-BitMapTree.html">BitMapTree</a></li><li><a href="module-Counter-Counter.html">Counter</a></li><li><a href="module-Counter-Leaf.html">Leaf</a></li><li><a href="module-Counter-Node.html">Node</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Thu Jan 25 2018 21:31:14 GMT+1100 (AEDT)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>