359 lines
		
	
	
		
			8.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			359 lines
		
	
	
		
			8.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!DOCTYPE html>
 | 
						|
<html>
 | 
						|
  <head>
 | 
						|
  <meta charset='UTF-8'>
 | 
						|
  <title>Yatta! Documentation</title>
 | 
						|
  <script src='../javascript/application.js'></script>
 | 
						|
  <script src='../javascript/search.js'></script>
 | 
						|
  <link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
 | 
						|
</head>
 | 
						|
  <body>
 | 
						|
    <div id='base' data-path='../'></div>
 | 
						|
<div id='header'>
 | 
						|
  <div id='menu'>
 | 
						|
    <a href='../extra/README.md.html' title='Yatta!'>
 | 
						|
      Yatta!
 | 
						|
    </a>
 | 
						|
    »
 | 
						|
    <a href='../alphabetical_index.html' title='Index'>
 | 
						|
      Index
 | 
						|
    </a>
 | 
						|
    »
 | 
						|
    <span class='title'>Operation</span>
 | 
						|
  </div>
 | 
						|
</div>
 | 
						|
    <div id='content'>
 | 
						|
      <h1>
 | 
						|
        Class:
 | 
						|
        Operation
 | 
						|
      </h1>
 | 
						|
      <table class='box'>
 | 
						|
        <tr>
 | 
						|
          <td>Defined in:</td>
 | 
						|
          <td>lib/Types/BasicTypes.coffee</td>
 | 
						|
        </tr>
 | 
						|
      </table>
 | 
						|
      <h2>Overview</h2>
 | 
						|
      <div class='docstring'>
 | 
						|
  <p>A generic interface to operations.</p><p>An operation has the following methods:
 | 
						|
_encode: encodes an operation (needed only if instance of this operation is sent).
 | 
						|
execute: execute the effects of this operations. Good examples are Insert-type and AddName-type
 | 
						|
val: in the case that the operation holds a value</p><p>Furthermore an encodable operation has a parser.</p>
 | 
						|
</div>
 | 
						|
<div class='tags'>
 | 
						|
</div>
 | 
						|
      <h2>Direct Known Subclasses</h2>
 | 
						|
      <p class='children'>
 | 
						|
        <a href='../class/Delete.html'>Delete</a>
 | 
						|
        <a href='../class/Insert.html'>Insert</a>
 | 
						|
        <a href='../class/Delimiter.html'>Delimiter</a>
 | 
						|
      </p>
 | 
						|
      <h2>Instance Method Summary</h2>
 | 
						|
      <ul class='summary'>
 | 
						|
  <li>
 | 
						|
    <span class='signature'>
 | 
						|
      <a href='#getUid-dynamic'>
 | 
						|
        #
 | 
						|
(void)
 | 
						|
<b>getUid</b><span>()</span>
 | 
						|
      </a>
 | 
						|
    </span>
 | 
						|
    <span class='desc'>
 | 
						|
      Computes a unique identifier (uid) that identifies this operation. 
 | 
						|
    </span>
 | 
						|
  </li>
 | 
						|
  <li>
 | 
						|
    <span class='signature'>
 | 
						|
      <a href='#execute-dynamic'>
 | 
						|
        #
 | 
						|
(void)
 | 
						|
<b>execute</b><span>()</span>
 | 
						|
      </a>
 | 
						|
    </span>
 | 
						|
    <span class='note private title'>Private</span>
 | 
						|
    <span class='desc'>
 | 
						|
      Notify the all the listeners. 
 | 
						|
    </span>
 | 
						|
  </li>
 | 
						|
  <li>
 | 
						|
    <span class='signature'>
 | 
						|
      <a href='#saveOperation-dynamic'>
 | 
						|
        ~
 | 
						|
(void)
 | 
						|
<b>saveOperation</b><span>(name, op_uid)</span>
 | 
						|
      </a>
 | 
						|
    </span>
 | 
						|
    <span class='note private title'>Private</span>
 | 
						|
    <span class='desc'>
 | 
						|
      Operations may depend on other operations (linked lists, etc.). 
 | 
						|
    </span>
 | 
						|
  </li>
 | 
						|
  <li>
 | 
						|
    <span class='signature'>
 | 
						|
      <a href='#validateSavedOperations-dynamic'>
 | 
						|
        #
 | 
						|
(Boolean)
 | 
						|
<b>validateSavedOperations</b><span>()</span>
 | 
						|
      </a>
 | 
						|
    </span>
 | 
						|
    <span class='note private title'>Private</span>
 | 
						|
    <span class='desc'>
 | 
						|
      After calling this function all not instantiated operations will be accessible. 
 | 
						|
    </span>
 | 
						|
  </li>
 | 
						|
</ul>
 | 
						|
      <h2>Constructor Details</h2>
 | 
						|
      <div class='methods'>
 | 
						|
  <div class='method_details'>
 | 
						|
    <p class='signature' id='constructor-dynamic'>
 | 
						|
      #
 | 
						|
(void)
 | 
						|
<b>constructor</b><span>(uid)</span>
 | 
						|
      <br>
 | 
						|
    </p>
 | 
						|
    <div class='tags'>
 | 
						|
  <h3>Parameters:</h3>
 | 
						|
  <ul class='param'>
 | 
						|
    <li>
 | 
						|
      <span class='name'>uid</span>
 | 
						|
      <span class='type'>
 | 
						|
        (
 | 
						|
          <tt>Object</tt>
 | 
						|
        )
 | 
						|
      </span>
 | 
						|
      —
 | 
						|
      <span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
 | 
						|
    </li>
 | 
						|
  </ul>
 | 
						|
  <h3>See also:</h3>
 | 
						|
  <ul class='see'>
 | 
						|
    <li>
 | 
						|
      <a href='HistoryBuffer.getNextOperationIdentifier'>HistoryBuffer.getNextOperationIdentifier</a>
 | 
						|
    </li>
 | 
						|
  </ul>
 | 
						|
</div>
 | 
						|
  </div>
 | 
						|
</div>
 | 
						|
      <h2>Instance Method Details</h2>
 | 
						|
      <div class='methods'>
 | 
						|
  <div class='method_details'>
 | 
						|
    <p class='signature' id='getUid-dynamic'>
 | 
						|
      #
 | 
						|
(void)
 | 
						|
<b>getUid</b><span>()</span>
 | 
						|
      <br>
 | 
						|
    </p>
 | 
						|
    <div class='docstring'>
 | 
						|
  <p>Computes a unique identifier (uid) that identifies this operation.</p>
 | 
						|
</div>
 | 
						|
<div class='tags'>
 | 
						|
</div>
 | 
						|
  </div>
 | 
						|
  <div class='method_details'>
 | 
						|
    <p class='signature' id='execute-dynamic'>
 | 
						|
      #
 | 
						|
(void)
 | 
						|
<b>execute</b><span>()</span>
 | 
						|
      <span class='note private'>Private</span>
 | 
						|
      <br>
 | 
						|
    </p>
 | 
						|
    <div class='docstring'>
 | 
						|
  <p>Notify the all the listeners.</p>
 | 
						|
</div>
 | 
						|
<div class='tags'>
 | 
						|
</div>
 | 
						|
  </div>
 | 
						|
  <div class='method_details'>
 | 
						|
    <p class='signature' id='saveOperation-dynamic'>
 | 
						|
      ~
 | 
						|
(void)
 | 
						|
<b>saveOperation</b><span>(name, op_uid)</span>
 | 
						|
      <br>
 | 
						|
      ~
 | 
						|
(void)
 | 
						|
<b>saveOperation</b><span>(name, op)</span>
 | 
						|
      <br>
 | 
						|
    </p>
 | 
						|
    <div class='docstring'>
 | 
						|
  <p>Operations may depend on other operations (linked lists, etc.).
 | 
						|
The saveOperation and validateSavedOperations methods provide
 | 
						|
an easy way to refer to these operations via an uid or object reference.</p><p>For example: We can create a new Delete operation that deletes the operation $o like this</p><pre><code>- var d = new Delete(uid, $o);   or
 | 
						|
- var d = new Delete(uid, $o.getUid());
 | 
						|
</code></pre><p>Either way we want to access $o via d.deletes. In the second case validateSavedOperations must be called first.</p>
 | 
						|
</div>
 | 
						|
<div class='tags'>
 | 
						|
  <div class='overloads'>
 | 
						|
    <h3>Overloads:</h3>
 | 
						|
    <div class='overload'>
 | 
						|
      <p class='signature'>
 | 
						|
        ~
 | 
						|
(void)
 | 
						|
<b>saveOperation</b><span>(name, op_uid)</span>
 | 
						|
      </p>
 | 
						|
      <div class='tags'>
 | 
						|
  <h3>Parameters:</h3>
 | 
						|
  <ul class='param'>
 | 
						|
    <li>
 | 
						|
      <span class='name'>name</span>
 | 
						|
      <span class='type'>
 | 
						|
        (
 | 
						|
          <tt>String</tt>
 | 
						|
        )
 | 
						|
      </span>
 | 
						|
      —
 | 
						|
      <span class='desc'>The name of the operation. After validating (with validateSavedOperations) the instantiated operation will be accessible via this[name]. </span>
 | 
						|
    </li>
 | 
						|
    <li>
 | 
						|
      <span class='name'>op_uid</span>
 | 
						|
      <span class='type'>
 | 
						|
        (
 | 
						|
          <tt>Object</tt>
 | 
						|
        )
 | 
						|
      </span>
 | 
						|
      —
 | 
						|
      <span class='desc'>A uid that refers to an operation </span>
 | 
						|
    </li>
 | 
						|
  </ul>
 | 
						|
</div>
 | 
						|
    </div>
 | 
						|
    <div class='overload'>
 | 
						|
      <p class='signature'>
 | 
						|
        ~
 | 
						|
(void)
 | 
						|
<b>saveOperation</b><span>(name, op)</span>
 | 
						|
      </p>
 | 
						|
      <div class='tags'>
 | 
						|
  <h3>Parameters:</h3>
 | 
						|
  <ul class='param'>
 | 
						|
    <li>
 | 
						|
      <span class='name'>name</span>
 | 
						|
      <span class='type'>
 | 
						|
        (
 | 
						|
          <tt>String</tt>
 | 
						|
        )
 | 
						|
      </span>
 | 
						|
      —
 | 
						|
      <span class='desc'>The name of the operation. After calling this function op is accessible via this[name]. </span>
 | 
						|
    </li>
 | 
						|
    <li>
 | 
						|
      <span class='name'>op</span>
 | 
						|
      <span class='type'>
 | 
						|
        (
 | 
						|
          <tt><a href='../class/Operation.html'>Operation</a></tt>
 | 
						|
        )
 | 
						|
      </span>
 | 
						|
      —
 | 
						|
      <span class='desc'>An Operation object </span>
 | 
						|
    </li>
 | 
						|
  </ul>
 | 
						|
</div>
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
</div>
 | 
						|
  </div>
 | 
						|
  <div class='method_details'>
 | 
						|
    <p class='signature' id='validateSavedOperations-dynamic'>
 | 
						|
      #
 | 
						|
(Boolean)
 | 
						|
<b>validateSavedOperations</b><span>()</span>
 | 
						|
      <span class='note private'>Private</span>
 | 
						|
      <br>
 | 
						|
    </p>
 | 
						|
    <div class='docstring'>
 | 
						|
  <p>After calling this function all not instantiated operations will be accessible.</p>
 | 
						|
</div>
 | 
						|
<div class='tags'>
 | 
						|
  <h3>Returns:</h3>
 | 
						|
  <ul class='return'>
 | 
						|
    <li>
 | 
						|
      <span class='type'></span>
 | 
						|
      (
 | 
						|
        <tt>Boolean</tt>
 | 
						|
      )
 | 
						|
      —
 | 
						|
      <span class='desc'>Whether it was possible to instantiate all operations. </span>
 | 
						|
    </li>
 | 
						|
  </ul>
 | 
						|
  <h3>See also:</h3>
 | 
						|
  <ul class='see'>
 | 
						|
    <li>
 | 
						|
      <a href='Operation.saveOperation'>Operation.saveOperation</a>
 | 
						|
    </li>
 | 
						|
  </ul>
 | 
						|
</div>
 | 
						|
  </div>
 | 
						|
</div>
 | 
						|
    </div>
 | 
						|
    <div id='footer'>
 | 
						|
  August 08, 14 04:37:31 by
 | 
						|
  <a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
 | 
						|
    Codo
 | 
						|
  </a>
 | 
						|
  2.0.9
 | 
						|
  ✲
 | 
						|
  Press H to see the keyboard shortcuts
 | 
						|
  ✲
 | 
						|
  <a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
 | 
						|
  ✲
 | 
						|
  <a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
 | 
						|
</div>
 | 
						|
<iframe id='search_frame'></iframe>
 | 
						|
<div id='fuzzySearch'>
 | 
						|
  <input type='text'>
 | 
						|
  <ol></ol>
 | 
						|
</div>
 | 
						|
<div id='help'>
 | 
						|
  <p>
 | 
						|
    Quickly fuzzy find classes, mixins, methods, file:
 | 
						|
  </p>
 | 
						|
  <ul>
 | 
						|
    <li>
 | 
						|
      <span>T</span>
 | 
						|
      Open fuzzy finder dialog
 | 
						|
    </li>
 | 
						|
  </ul>
 | 
						|
  <p>
 | 
						|
    Control the navigation frame:
 | 
						|
  </p>
 | 
						|
  <ul>
 | 
						|
    <li>
 | 
						|
      <span>L</span>
 | 
						|
      Toggle list view
 | 
						|
    </li>
 | 
						|
    <li>
 | 
						|
      <span>C</span>
 | 
						|
      Show class list
 | 
						|
    </li>
 | 
						|
    <li>
 | 
						|
      <span>I</span>
 | 
						|
      Show mixin list
 | 
						|
    </li>
 | 
						|
    <li>
 | 
						|
      <span>F</span>
 | 
						|
      Show file list
 | 
						|
    </li>
 | 
						|
    <li>
 | 
						|
      <span>M</span>
 | 
						|
      Show method list
 | 
						|
    </li>
 | 
						|
    <li>
 | 
						|
      <span>E</span>
 | 
						|
      Show extras list
 | 
						|
    </li>
 | 
						|
  </ul>
 | 
						|
  <p>
 | 
						|
    You can focus and blur the search input:
 | 
						|
  </p>
 | 
						|
  <ul>
 | 
						|
    <li>
 | 
						|
      <span>S</span>
 | 
						|
      Focus search input
 | 
						|
    </li>
 | 
						|
    <li>
 | 
						|
      <span>Esc</span>
 | 
						|
      Blur search input
 | 
						|
    </li>
 | 
						|
  </ul>
 | 
						|
</div>
 | 
						|
  </body>
 | 
						|
</html> |