1 | <!DOCTYPE html> <html> <head> <title>ByteIterable.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="ByteIterable.html"> ByteIterable.coffee </a> <a class="source" href="ByteIterator.html"> ByteIterator.coffee </a> <a class="source" href="ArrayByteIterable.html"> ArrayByteIterable.coffee </a> <a class="source" href="ByteIterableBase.html"> ByteIterableBase.coffee </a> <a class="source" href="ByteIterableUtil.html"> ByteIterableUtil.coffee </a> <a class="source" href="LightOutputStream.html"> LightOutputStream.coffee </a> <a class="source" href="StoreConfiguration.html"> StoreConfiguration.coffee </a> <a class="source" href="Reader.html"> Reader.coffee </a> <a class="source" href="Writer.html"> Writer.coffee </a> <a class="source" href="List.html"> List.coffee </a> <a class="source" href="ListNode.html"> ListNode.coffee </a> <a class="source" href="Cursor.html"> Cursor.coffee </a> <a class="source" href="DatabaseRoot.html"> DatabaseRoot.coffee </a> <a class="source" href="Environment.html"> Environment.coffee </a> <a class="source" href="EnvironmentConfig.html"> EnvironmentConfig.coffee </a> <a class="source" href="Store.html"> Store.coffee </a> <a class="source" href="Transaction.html"> Transaction.coffee </a> <a class="source" href="Addr64.html"> Addr64.coffee </a> <a class="source" href="DataIterator.html"> DataIterator.coffee </a> <a class="source" href="Log.html"> Log.coffee </a> <a class="source" href="LogCache.html"> LogCache.coffee </a> <a class="source" href="LogConfig.html"> LogConfig.coffee </a> <a class="source" href="LogUtil.html"> LogUtil.coffee </a> <a class="source" href="Loggable.html"> Loggable.coffee </a> <a class="source" href="LoggableFactory.html"> LoggableFactory.coffee </a> <a class="source" href="LoggableIterator.html"> LoggableIterator.coffee </a> <a class="source" href="LoggableToWrite.html"> LoggableToWrite.coffee </a> <a class="source" href="NullLoggable.html"> NullLoggable.coffee </a> <a class="source" href="RandomAccessByteIterable.html"> RandomAccessByteIterable.coffee </a> <a class="source" href="RandomAccessLoggable.html"> RandomAccessLoggable.coffee </a> <a class="source" href="RandomAccessLoggableIterator.html"> RandomAccessLoggableIterator.coffee </a> <a class="source" href="StackList.html"> StackList.coffee </a> <a class="source" href="CompoundByteIterable.html"> CompoundByteIterable.coffee </a> <a class="source" href="CompoundByteIteratorBase.html"> CompoundByteIteratorBase.coffee </a> <a class="source" href="CompressedUnsignedLongByteIterable.html"> CompressedUnsignedLongByteIterable.coffee </a> <a class="source" href="FixedLengthByteIterable.html"> FixedLengthByteIterable.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> ByteIterable.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nv">EventEmitter = </span><span class="p">(</span><span class="nx">require</span> <span class="s1">'events'</span><span class="p">).</span><span class="nx">EventEmitter</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">¶</a> </div> <p>This class is the base for all other iterables.</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">class</span> <span class="nx">ByteIterable</span> <span class="k">extends</span> <span class="nx">EventEmitter</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">¶</a> </div> <p>This iterator is kind of 0.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="vi">@EMPTY_ITERATOR =</span>
|
2 | <span class="nx">hasNext</span><span class="nv">$emit: </span><span class="nf">() -></span>
|
3 | <span class="k">return</span> <span class="kc">false</span>
|
4 |
|
5 | <span class="nx">next</span><span class="nv">$emit: </span><span class="nf">() -></span>
|
6 | <span class="k">return</span> <span class="mi">0</span>
|
7 |
|
8 | <span class="nx">skip</span><span class="nv">$int: </span><span class="nf">(length) -></span>
|
9 | <span class="k">return</span> <span class="mi">0</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">¶</a> </div> <p>This iterable is kind of 0.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="vi">@EMPTY =</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">¶</a> </div> <p>@private</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">emptyBytes: </span><span class="k">new</span> <span class="nx">Buffer</span> <span class="mi">0</span>
|
10 |
|
11 | <span class="nv">iterator: </span><span class="nf">() -></span>
|
12 | <span class="k">return</span> <span class="nx">ByteIterable</span><span class="p">.</span><span class="nx">EMPTY_ITERATOR</span>
|
13 |
|
14 | <span class="nx">compareTo$ByteIterable</span><span class="nv">$emit: </span><span class="nf">(right) -></span>
|
15 | <span class="k">return</span> <span class="nx">right</span><span class="p">.</span><span class="nx">iterator</span><span class="p">.</span><span class="nx">hasNext</span><span class="p">()</span> <span class="o">?</span> <span class="o">-</span><span class="mi">1</span> <span class="o">:</span> <span class="mi">0</span>
|
16 |
|
17 | <span class="nv">getBytesUnsafe: </span><span class="nf">() -></span>
|
18 | <span class="k">return</span> <span class="nx">@emptyBytes</span>
|
19 |
|
20 | <span class="nv">getLength: </span><span class="nf">() -></span>
|
21 | <span class="k">return</span> <span class="mi">0</span>
|
22 |
|
23 | <span class="nv">toString: </span><span class="nf">() -></span>
|
24 | <span class="k">return</span> <span class="s2">"[ByteIterable.EMPTY]"</span>
|
25 |
|
26 | <span class="nv">exports.ByteIterable = </span><span class="nx">ByteIterable</span>
|
27 |
|
28 | </pre></div> </td> </tr> </tbody> </table> </div> </body> </html> |
\ | No newline at end of file |