Edit D:\app\Administrator\product\11.2.0\dbhome_1\perl\html\lib\Tie\Array.html
<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Tie::Array - base class for tied arrays</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:" /> </head> <body style="background-color: white"> <table border="0" width="100%" cellspacing="0" cellpadding="3"> <tr><td class="block" style="background-color: #cccccc" valign="middle"> <big><strong><span class="block"> Tie::Array - base class for tied arrays</span></strong></big> </td></tr> </table> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#synopsis">SYNOPSIS</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#caveats">CAVEATS</a></li> <li><a href="#author">AUTHOR</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <h1><a name="name">NAME</a></h1> <p>Tie::Array - base class for tied arrays</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> package Tie::NewArray; use Tie::Array; @ISA = ('Tie::Array');</pre> <pre> # mandatory methods sub TIEARRAY { ... } sub FETCH { ... } sub FETCHSIZE { ... }</pre> <pre> sub STORE { ... } # mandatory if elements writeable sub STORESIZE { ... } # mandatory if elements can be added/deleted sub EXISTS { ... } # mandatory if exists() expected to work sub DELETE { ... } # mandatory if delete() expected to work</pre> <pre> # optional methods - for efficiency sub CLEAR { ... } sub PUSH { ... } sub POP { ... } sub SHIFT { ... } sub UNSHIFT { ... } sub SPLICE { ... } sub EXTEND { ... } sub DESTROY { ... }</pre> <pre> package Tie::NewStdArray; use Tie::Array;</pre> <pre> @ISA = ('Tie::StdArray');</pre> <pre> # all methods provided by default</pre> <pre> package main;</pre> <pre> $object = tie @somearray,Tie::NewArray; $object = tie @somearray,Tie::StdArray; $object = tie @somearray,Tie::NewStdArray;</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>This module provides methods for array-tying classes. See <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perltie.html">the perltie manpage</a> for a list of the functions required in order to tie an array to a package. The basic <strong>Tie::Array</strong> package provides stub <code>DESTROY</code>, and <code>EXTEND</code> methods that do nothing, stub <code>DELETE</code> and <code>EXISTS</code> methods that <code>croak()</code> if the <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#delete"><code>delete()</code></a> or <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#exists"><code>exists()</code></a> builtins are ever called on the tied array, and implementations of <code>PUSH</code>, <code>POP</code>, <code>SHIFT</code>, <code>UNSHIFT</code>, <code>SPLICE</code> and <code>CLEAR</code> in terms of basic <code>FETCH</code>, <code>STORE</code>, <code>FETCHSIZE</code>, <code>STORESIZE</code>.</p> <p>The <strong>Tie::StdArray</strong> package provides efficient methods required for tied arrays which are implemented as blessed references to an "inner" perl array. It inherits from <strong>Tie::Array</strong>, and should cause tied arrays to behave exactly like standard arrays, allowing for selective overloading of methods.</p> <p>For developers wishing to write their own tied arrays, the required methods are briefly defined below. See the <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perltie.html">the perltie manpage</a> section for more detailed descriptive, as well as example code:</p> <dl> <dt><strong><a name="tiearray_classname_list2" class="item">TIEARRAY classname, LIST</a></strong> <dd> <p>The class method is invoked by the command <code>tie @array, classname</code>. Associates an array instance with the specified class. <code>LIST</code> would represent additional arguments (along the lines of <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/lib/AnyDBM_File.html">the AnyDBM_File manpage</a> and compatriots) needed to complete the association. The method should return an object of a class which provides the methods below.</p> </dd> </li> <dt><strong><a name="store_this_index_value2" class="item">STORE this, index, value</a></strong> <dd> <p>Store datum <em>value</em> into <em>index</em> for the tied array associated with object <em>this</em>. If this makes the array larger then class's mapping of <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#undef"><code>undef</code></a> should be returned for new positions.</p> </dd> </li> <dt><strong><a name="fetch_this_index2" class="item">FETCH this, index</a></strong> <dd> <p>Retrieve the datum in <em>index</em> for the tied array associated with object <em>this</em>.</p> </dd> </li> <dt><strong><a name="fetchsize_this2" class="item">FETCHSIZE this</a></strong> <dd> <p>Returns the total number of items in the tied array associated with object <em>this</em>. (Equivalent to <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#scalar"><code>scalar(@array)</code></a>).</p> </dd> </li> <dt><strong><a name="storesize_this_count2" class="item">STORESIZE this, count</a></strong> <dd> <p>Sets the total number of items in the tied array associated with object <em>this</em> to be <em>count</em>. If this makes the array larger then class's mapping of <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#undef"><code>undef</code></a> should be returned for new positions. If the array becomes smaller then entries beyond count should be deleted.</p> </dd> </li> <dt><strong><a name="extend_this_count2" class="item">EXTEND this, count</a></strong> <dd> <p>Informative call that array is likely to grow to have <em>count</em> entries. Can be used to optimize allocation. This method need do nothing.</p> </dd> </li> <dt><strong><a name="exists_this_key3" class="item">EXISTS this, key</a></strong> <dd> <p>Verify that the element at index <em>key</em> exists in the tied array <em>this</em>.</p> </dd> <dd> <p>The <strong>Tie::Array</strong> implementation is a stub that simply croaks.</p> </dd> </li> <dt><strong><a name="delete_this_key3" class="item">DELETE this, key</a></strong> <dd> <p>Delete the element at index <em>key</em> from the tied array <em>this</em>.</p> </dd> <dd> <p>The <strong>Tie::Array</strong> implementation is a stub that simply croaks.</p> </dd> </li> <dt><strong><a name="clear_this3" class="item">CLEAR this</a></strong> <dd> <p>Clear (remove, delete, ...) all values from the tied array associated with object <em>this</em>.</p> </dd> </li> <dt><strong><a name="destroy_this6" class="item">DESTROY this</a></strong> <dd> <p>Normal object destructor method.</p> </dd> </li> <dt><strong><a name="push_this_list2" class="item">PUSH this, LIST</a></strong> <dd> <p>Append elements of LIST to the array.</p> </dd> </li> <dt><strong><a name="pop_this2" class="item">POP this</a></strong> <dd> <p>Remove last element of the array and return it.</p> </dd> </li> <dt><strong><a name="shift_this2" class="item">SHIFT this</a></strong> <dd> <p>Remove the first element of the array (shifting other elements down) and return it.</p> </dd> </li> <dt><strong><a name="unshift_this_list2" class="item">UNSHIFT this, LIST</a></strong> <dd> <p>Insert LIST elements at the beginning of the array, moving existing elements up to make room.</p> </dd> </li> <dt><strong><a name="splice_this_offset_length_list2" class="item">SPLICE this, offset, length, LIST</a></strong> <dd> <p>Perform the equivalent of <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#splice"><code>splice</code></a> on the array.</p> </dd> <dd> <p><em>offset</em> is optional and defaults to zero, negative values count back from the end of the array.</p> </dd> <dd> <p><em>length</em> is optional and defaults to rest of the array.</p> </dd> <dd> <p><em>LIST</em> may be empty.</p> </dd> <dd> <p>Returns a list of the original <em>length</em> elements at <em>offset</em>.</p> </dd> </li> </dl> <p> </p> <hr /> <h1><a name="caveats">CAVEATS</a></h1> <p>There is no support at present for tied @ISA. There is a potential conflict between magic entries needed to notice setting of @ISA, and those needed to implement 'tie'.</p> <p>Very little consideration has been given to the behaviour of tied arrays when <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlvar.html#__"><code>$[</code></a> is not default value of zero.</p> <p> </p> <hr /> <h1><a name="author">AUTHOR</a></h1> <p>Nick Ing-Simmons <<a href="mailto:nik@tiuk.ti.com">nik@tiuk.ti.com</a>></p> <table border="0" width="100%" cellspacing="0" cellpadding="3"> <tr><td class="block" style="background-color: #cccccc" valign="middle"> <big><strong><span class="block"> Tie::Array - base class for tied arrays</span></strong></big> </td></tr> </table> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de