documentation/ParserList.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Class: ParserList - Documentation</title>

    <script src="scripts/prettify/prettify.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">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-miew.css">
</head>

<body>

<div id="main">
    <h1 class="page-title">Class: ParserList</h1>

    




<section>

<header>
    
        <h2>ParserList</h2>
        
            <div class="class-description"><p>A list of available parsers.</p></div>
        
    
</header>

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

    
    <h2>Constructor</h2>
    

    <h4 class="name" id="ParserList"><span class="type-signature"></span>new ParserList<span class="signature">(someParsers<span class="signature-attributes">opt, non-null</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>Create a list of parsers.
The parsers are indexed by supported data formats and file extensions (<code>.formats</code> and
<code>.extensions</code> properties of a Parser subclass).
The parsers can be retrieved later by matching against specs (see <code>ParsrerList#find</code>).</p>
</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>someParsers</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;function(new:Parser)></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>A list of <code>Parser</code> subclasses to
automatically register at creation time.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="ParserList.html#register">ParserList#register</a></li>
        </ul>
    </dd>
    

    
</dl>
















    
    </div>

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

        


    <ul>
        <li><a href="EntityList.html">EntityList</a></li>
    </ul>


    

    

    

     

    

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

        
            
<h4 class="name" id="all"><span class="type-signature">(non-null) </span>all<span class="type-signature"> :Array.&lt;Object></span></h4>




<div class="description">
    <p>An ordered list of all registered entities.
It is a read-only copy, use <a href="EntityList.html#register"><code>EntityList#register</code></a> and <a href="EntityList.html#unregister"><code>EntityList#unregister</code></a>
to modify it.</p>
</div>







<dl class="details">

    

    

    

    
    <dt class="tag-overrides">Overrides:</dt>
    <dd class="tag-overrides"><ul class="dummy"><li>
        <a href="EntityList.html#all">EntityList#all</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>






        
            
<h4 class="name" id="first"><span class="type-signature"></span>first<span class="type-signature"> :Object</span></h4>




<div class="description">
    <p>The first registered entity.
Use it if you do not care which entity you are referring to.</p>
</div>







<dl class="details">

    

    

    

    
    <dt class="tag-overrides">Overrides:</dt>
    <dd class="tag-overrides"><ul class="dummy"><li>
        <a href="EntityList.html#first">EntityList#first</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>






        
    

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

        
            

    

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

    



<div class="description">
    <p>Find a suitable parser for data.</p>
</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>specs</code></td>
            

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


            
            </td>

            

            

            <td class="description last"><p>Parser specifications.</p>
                <h6>Properties</h6>
                

<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>format</code></td>
            

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


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Supported data format.</p></td>
        </tr>

    

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

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


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Supported filename extension.</p></td>
        </tr>

    

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

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


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Data to parse.</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(key, index<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>

    



<div class="description">
    <p>Retrieve an entity by its key.</p>
</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>key</code></td>
            

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


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>A case-insensitive property value to look-up.</p></td>
        </tr>

    

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

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


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>One of the indices specified during the list construction. If omitted,
the first of the indices is used.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    
    <dt class="tag-overrides">Overrides:</dt>
    <dd class="tag-overrides"><ul class="dummy"><li>
        <a href="EntityList.html#get">EntityList#get</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>An object registered in the index under the key. If there are multiple
objects under the same key, the first one is returned.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="keys"><span class="type-signature"></span>keys<span class="signature">(index<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {Array.&lt;string>}</span></h4>

    



<div class="description">
    <p>Retrieve a list of keys for the index.</p>
</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">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>One of the indices specified during the list construction. If omitted,
the first of the indices is used.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    
    <dt class="tag-overrides">Overrides:</dt>
    <dd class="tag-overrides"><ul class="dummy"><li>
        <a href="EntityList.html#keys">EntityList#keys</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>An unordered list of keys in the index, i.e. particular property
values for all registered entities.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;string></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="register"><span class="type-signature"></span>register<span class="signature">(entity<span class="signature-attributes">non-null</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>Add an entity to this list.</p>
</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>entity</code></td>
            

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


            
            </td>

            

            

            <td class="description last"><p>An object or a class to register. The object must include all
properties specified as indices on construction.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    
    <dt class="tag-overrides">Overrides:</dt>
    <dd class="tag-overrides"><ul class="dummy"><li>
        <a href="EntityList.html#register">EntityList#register</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="EntityList.html#unregister">EntityList#unregister</a></li>
        </ul>
    </dd>
    

    
</dl>
















        
            

    

    <h4 class="name" id="unregister"><span class="type-signature"></span>unregister<span class="signature">(entity<span class="signature-attributes">non-null</span>)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>Remove an entity from this list.</p>
</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>entity</code></td>
            

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


            
            </td>

            

            

            <td class="description last"><p>An object or a class to unregister. The object may be
missing from the list but it must include all properties specified as indices
on construction.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    
    <dt class="tag-overrides">Overrides:</dt>
    <dd class="tag-overrides"><ul class="dummy"><li>
        <a href="EntityList.html#unregister">EntityList#unregister</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="EntityList.html#register">EntityList#register</a></li>
        </ul>
    </dd>
    

    
</dl>
















        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="SettingsObject.html">SettingsObject</a></li></ul><h3>Classes</h3><ul><li><a href="EntityList.html">EntityList</a></li><li><a href="EventDispatcher.html">EventDispatcher</a></li><li><a href="GROParser.html">GROParser</a></li><li><a href="GROReader.html">GROReader</a></li><li><a href="Helix.html">Helix</a></li><li><a href="LoaderList.html">LoaderList</a></li><li><a href="Logger.html">Logger</a></li><li><a href="Miew.html">Miew</a></li><li><a href="ParserList.html">ParserList</a></li><li><a href="PDBStream.html">PDBStream</a></li><li><a href="Strand.html">Strand</a></li><li><a href="StructuralElement.html">StructuralElement</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-embed.html">Embedding the Viewer</a></li><li><a href="tutorial-events.html">events</a></li><li><a href="tutorial-selectors.html">Selection Language</a></li><li><a href="tutorial-url.html">URL Query String</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a> on Thu Dec 16 2021 21:46:10 GMT+0300 (Москва, стандартное время)
</footer>

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