Added: websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Docs/WritingClasses.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Docs/WritingClasses.html (added) +++ websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Docs/WritingClasses.html Wed Sep 28 12:07:48 2016 @@ -0,0 +1,729 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Clownfish::Docs::WritingClasses â Apache Clownfish Documentation</title> + <link rel="stylesheet" type="text/css" media="screen" href="/css/lucy.css"> + </head> + + <body> + + <div id="lucy-rigid_wrapper"> + + <div id="lucy-top" class="container_16 lucy-white_box_3d"> + + <div id="lucy-logo_box" class="grid_8"> + <a href="/"><img src="/images/lucy_logo_150x100.png" alt="Apache Lucyâ¢"></a> + </div> <!-- lucy-logo_box --> + + <div #id="lucy-top_nav_box" class="grid_8"> + <div id="lucy-top_nav_bar" class="container_8"> + <ul> + <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li> + <li><a href="http://www.apache.org/licenses/" title="License">License</a></li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li> + <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li> + <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li> + </ul> + </div> <!-- lucy-top_nav_bar --> + <p><a href="http://www.apache.org/">Apache</a> » <a href="/">Lucy</a> » <a href="/docs/">Docs</a> » <a href="/docs/0.5.0/">0.5.0</a> » <a href="/docs/0.5.0/perl/">Perl</a> » <a href="/docs/0.5.0/perl/Clownfish/">Clownfish</a> » <a href="/docs/0.5.0/perl/Clownfish/Docs/">Docs</a></p> + <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get"> + <input value="*.apache.org" name="sitesearch" type="hidden"/> + <input type="text" name="q" id="query" style="width:85%"> + <input type="submit" id="submit" value="Search"> + </form> + </div> <!-- lucy-top_nav_box --> + + <div class="clear"></div> + + </div> <!-- lucy-top --> + + <div id="lucy-main_content" class="container_16 lucy-white_box_3d"> + + <div class="grid_4" id="lucy-left_nav_box"> + <h6>About</h6> + <ul> + <li><a href="/">Welcome</a></li> + <li><a href="/clownfish.html">Clownfish</a></li> + <li><a href="/faq.html">FAQ</a></li> + <li><a href="/people.html">People</a></li> + </ul> + <h6>Resources</h6> + <ul> + <li><a href="/download.html">Download</a></li> + <li><a href="/mailing_lists.html">Mailing Lists</a></li> + <li><a href="/docs/">Documentation</a></li> + <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li> + <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li> + <li><a href="/version_control.html">Version Control</a></li> + </ul> + <h6>Related Projects</h6> + <ul> + <li><a href="http://lucene.apache.org/core/">Lucene</a></li> + <li><a href="http://dezi.org/">Dezi</a></li> + <li><a href="http://lucene.apache.org/solr/">Solr</a></li> + <li><a href="http://lucenenet.apache.org/">Lucene.NET</a></li> + <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li> + </ul> + </div> <!-- lucy-left_nav_box --> + + <div id="lucy-main_content_box" class="grid_9"> + <div> +<a name='___top' class='dummyTopAnchor' ></a> + +<h2><a class='u' +name="NAME" +>NAME</a></h2> + +<p>Clownfish::Docs::WritingClasses - Writing Apache Clownfish classes</p> + +<h2><a class='u' +name="DESCRIPTION" +>DESCRIPTION</a></h2> + +<h3><a class='u' +name="Parcels" +>Parcels</a></h3> + +<p>Every Clownfish class belongs to a Clownfish parcel. +Parcels are used for namespacing and versioning. +Information about parcels is stored in <code>.cfp</code> files which contain a JSON hash with the following keys:</p> + +<ul> +<li><b>name:</b> The parcel’s name. +It must contain only letters.</li> + +<li><b>nickname:</b> A short nickname. +It must contain only letters. +This nickname, +followed by an underscore, +is used to prefix generated C symbols and macros. +Depending on the kind of symbol, +a lowercase or uppercase prefix will be used.</li> + +<li><b>version:</b> A version specifier of the following form (without whitespace): +<pre>version-specifier = "v" version-number +version-number = digit+ | digit+ "." version-number</pre> +</li> + +<li><b>prerequisites:</b> A hash containing the prerequisite parcels. +The hash keys are the parcel names. +The values contain the minimum required version.</li> +</ul> + +<p>An example <code>.cfp</code> file might look like:</p> + +<pre>{ + "name": "Pathfinder", + "nickname": "Pfind", + "version": "v2.3.8", + "prerequisites": { + "Clownfish": "v0.5.0" + } +}</pre> + +<p>A parcel specifier of the following form is used in Clownfish header files:</p> + +<pre>parcel-specifier = "parcel" parcel-name ";" +parcel-name = identifier</pre> + +<p>For example:</p> + +<pre>parcel Pathfinder;</pre> + +<p>Every <code>.cfh</code> file starts with a parcel specifier containing the name of the parcel for all classes in the header file.</p> + +<h4><a class='u' +name="Initialization" +>Initialization</a></h4> + +<p>Every Clownfish parcel must be initialized before it is used. +The initialization function is named <code>{parcel_nick}_bootstrap_parcel</code> and takes no arguments.</p> + +<p>Example call:</p> + +<pre>pfind_bootstrap_parcel();</pre> + +<p>The generated host language bindings call the bootstrap function automatically. +C projects must call the function manually.</p> + +<h4><a class='u' +name="Short_names" +>Short names</a></h4> + +<p>If a macro with the uppercase name <code>{PARCEL_NICK}_USE_SHORT_NAMES</code> is defined before including a generated C header, +additional macros without the parcel prefix will be defined for most symbols.</p> + +<p>Example:</p> + +<pre>#define PFIND_USE_SHORT_NAMES +#include <Pathfinder/Graph.h> +#include <Pathfinder/Path.h> + +/* Prefixes can be omitted. */ +Path *path = Graph_Find_Shortest_Path(graph); + +/* Without PFIND_USE_SHORT_NAMES, one would have to write: */ +pfind_Path *path = PFIND_Graph_Find_Shortest_Path(graph);</pre> + +<p>For object types in Clownfish header files, +prefixes of class structs can also be omitted unless multiple parcels declare classes with the same last component of the class name.</p> + +<h4><a class='u' +name="The_(8220)Clownfish(8221)_parcel" +>The “Clownfish” parcel</a></h4> + +<p>The Clownfish runtime classes live in a parcel named <code>Clownfish</code> with nickname <code>Cfish</code>. +Consequently, +the short name macro is named <code>CFISH_USE_SHORT_NAMES</code>.</p> + +<h3><a class='u' +name="Declaring_classes" +>Declaring classes</a></h3> + +<p>Classes are declared in Clownfish header files using a declaration of the following form:</p> + +<pre>class-declaration = class-exposure-specifier? + class-modifier* + "class" class-name + ("nickname" class-nickname)? + ("inherits" class-name)? + "{" class-contents "}" +class-exposure-specifier = "public" +class-modifier = "inert" | "final" +class-name = identifier | identifier "::" class-name +class-nickname = identifier +class-contents = (variable-declaration | function-declaration)*</pre> + +<p>Class name components must start with an uppercase letter and must not contain underscores. +The last component must contain at least one lowercase letter and must be unique for every class in a parcel.</p> + +<p>For every class, +a type with the name <code>{parcel_nick}_{Class_Last_Comp}</code> is defined in the generated C header. +This is an opaque typedef used to ensure type safety.</p> + +<p>For every class, +a global variable with the uppercase name <code>{PARCEL_NICK}_{CLASS_LAST_COMP}</code> is defined. +This variable is a pointer to a Clownfish::Class object which is initialized when bootstrapping the parcel.</p> + +<p>Non-inert classes inherit from Clownfish::Obj by default.</p> + +<p>Example of a class declaration:</p> + +<pre>parcel Pathfinder; + +public class Pathfinder::Graph::VisibilityGraph nickname VisGraph + extends Clownfish::Obj { + /* Variables and functions */ +}</pre> + +<p>This will generate:</p> + +<pre>typedef struct pfind_VisibilityGraph pfind_VisibilityGraph; +extern cfish_Class *PFIND_VISIBILITYGRAPH;</pre> + +<h4><a class='u' +name="Class_exposure" +>Class exposure</a></h4> + +<p>API documentation will only be generated for classes with <code>public</code> exposure.</p> + +<h4><a class='u' +name="Inert_classes" +>Inert classes</a></h4> + +<p>Inert classes must contain only inert variables or inert functions, +that is, +neither instance variables nor methods. +They must not inherit from another class nor be inherited from. +They’re essentially nothing more than a namespace for functions and global variables.</p> + +<h4><a class='u' +name="Final_classes" +>Final classes</a></h4> + +<p>For final classes, +every method is made final, +regardless of the method modifier. +Final classes must not be inherited from.</p> + +<h3><a class='u' +name="Variables" +>Variables</a></h3> + +<p>Variables are declared with a declaration of the following form:</p> + +<pre>variable-declaration = variable-modifier* + type variable-name ";" +variable-modifier = "inert" +variable-name = identifier</pre> + +<h4><a class='u' +name="Inert_variables" +>Inert variables</a></h4> + +<p>Inert variables are global class variables of which only a single copy exists. +They are declared in the generated C header with the name <code>{parcel_nick}_{Class_Nick}_{Variable_Name}</code> and must be defined in a C source file.</p> + +<p>Example:</p> + +<pre>public class Pathfinder::Path { + public inert int max_path_length; +}</pre> + +<p>This will generate:</p> + +<pre>extern int pfind_Path_max_path_length;</pre> + +<p>The C source file defining the variable will typically use short names. +So the definition will look like:</p> + +<pre>int Path_max_path_length = 5000;</pre> + +<h4><a class='u' +name="Instance_variables" +>Instance variables</a></h4> + +<p>Non-inert variables are instance variables and added to the class’s ivars struct.</p> + +<p>Example:</p> + +<pre>public class Pathfinder::Path { + int num_nodes; + + public int + Get_Num_Nodes(Path *self); +}</pre> + +<p>This will add a <code>num_nodes</code> member to the ivars struct of <code>Path</code>.</p> + +<h4><a class='u' +name="The_ivars_struct" +>The ivars struct</a></h4> + +<p>To access instance variables, +the macro <code>C_{PARCEL_NICK}_{CLASS_LAST_COMP}</code> must be defined before including the generated header file. +This will make a struct named <code>{parcel_nick}_{Class_Name}IVARS</code> with a corresponding typedef and short name available that contains all instance variables of the class and all superclasses from the same parcel. +Instance variables defined in other parcels are not accessible. +This is by design to guarantee ABI stability if the instance variable layout of a superclass from another parcel changes in a different version. +If you need to access an instance variable from another parcel, +add accessor methods.</p> + +<p>A pointer to the ivars struct can be obtained by calling an inline function named <code>{parcel_nick}_{Class_Name}_IVARS</code>. +This function takes the object of the class (typically <code>self</code>) as argument.</p> + +<p>Example using short names:</p> + +<pre>#define C_PFIND_PATH +#define PFIND_USE_SHORT_NAMES +#include "Pathfinder/Path.h" + +int +Path_get_num_nodes(Path *self) { + PathIVARS *ivars = Path_IVARS(self); + return ivars->num_nodes; +}</pre> + +<h3><a class='u' +name="Functions" +>Functions</a></h3> + +<pre>function-declaration = function-exposure-specifier? + function-modifier* + return-type function-name + "(" param-list? ")" ";" +function-exposure-specifier = "public" +function-modifier = "inert" | "inline" | "abstract" | "final" +return-type = return-type-qualifier* type +return-type-qualifier = "incremented" | "nullable" +function-name = identifier +param-list = param | param "," param-list +param = param-qualifier* type param-name ("=" scalar-constant)? +param-name = identifier +param-qualifier = "decremented"</pre> + +<h4><a class='u' +name="Function_exposure" +>Function exposure</a></h4> + +<p>API documentation will only be generated for functions with <code>public</code> exposure.</p> + +<h4><a class='u' +name="Inert_functions" +>Inert functions</a></h4> + +<p>Inert functions are dispatched statically. +They are declared in the generated C header with the name <code>{parcel_nick}_{Class_Nick}_{Function_Name}</code> and must be defined in a C source file. +They must be neither abstract nor final.</p> + +<p>Example:</p> + +<pre>public class Pathfinder::Graph::VisibilityGraph nickname VisGraph + extends Clownfish::Obj { + + public inert incremented VisibilityGraph* + new(int node_capacity); +}</pre> + +<p>This will generate:</p> + +<pre>pfind_VisibilityGraph* +pfind_VisGraph_new(int node_capacity);</pre> + +<p>The C source file implementing the inert function will typically use short names. +So the implementation will look like:</p> + +<pre>#define PFIND_USE_SHORT_NAMES +#include "Pathfinder/Graph/VisibilityGraph.h" + +VisibilityGraph* +VisGraph_new(int node_capacity) { + /* Implementation */ +}</pre> + +<h4><a class='u' +name="Inline_functions" +>Inline functions</a></h4> + +<p>Inert functions can be inline. +They should be defined as static inline functions in a C block in the Clownfish header file. +The macro <code>CFISH_INLINE</code> expands to the C compiler’s inline keyword and should be used for portability.</p> + +<h4><a class='u' +name="Methods" +>Methods</a></h4> + +<p>Non-inert functions are dynamically dispatched methods. +Their name must start with an uppercase letter and every underscore must be followed by an uppercase letter. +Methods must not be declared inline.</p> + +<p>The first parameter of a method must be a pointer to an object of the method’s class which receives the object on which the method was invoked. +By convention, +this parameter is named <code>self</code>.</p> + +<p>For every method, +an inline wrapper for dynamic dispatch is defined in the generated C header with the name <code>{PARCEL_NICK}_{Class_Nick}_{Method_Name}</code>. +Additionally, +an implementing function is declared with the name <code>{PARCEL_NICK}_{Class_Nick}_{Method_Name}_IMP</code>. +The Clownfish compiler also generates a typedef for the method’s function pointer type named <code>{PARCEL_NICK}_{Class_Nick}_{Method_Name}_t</code>. +Wrappers and typedefs are created for all subclasses whether they override a method or not.</p> + +<p>Example:</p> + +<pre>public class Pathfinder::Graph::VisibilityGraph nickname VisGraph + extends Clownfish::Obj { + + public void + Add_Node(VisibilityGraph *self, decremented Node *node); +}</pre> + +<p>This will generate:</p> + +<pre>/* Wrapper for dynamic dispatch */ +static inline void +PFIND_VisGraph_Add_Node(pfind_VisibilityGraph *self, pfind_Node *node) { + /* Inline code for wrapper */ +} + +/* Declaration of implementing function */ +void +PFIND_VisGraph_Add_Node_IMP(pfind_VisibilityGraph *self, + pfind_Node *node); + +/* Declaration of function pointer type */ +typedef void +(*PFIND_VisGraph_Add_Node_t)(pfind_VisibilityGraph *self, + pfind_Node *node);</pre> + +<p>The implementing function of non-abstract methods must be defined in a C source file. +This file will typically define the short names macro. +So the implementation will look like:</p> + +<pre>#define PFIND_USE_SHORT_NAMES +#include "Pathfinder/Graph/VisibilityGraph.h" + +void +VisGraph_Add_Node_IMP(VisibilityGraph *self, Node *node) { + /* Implementation */ +}</pre> + +<h4><a class='u' +name="Looking_up_methods" +>Looking up methods</a></h4> + +<p>Clownfish defines a macro named <code>CFISH_METHOD_PTR</code> that looks up the pointer to the implementing function of a method. +The first parameter of the macro is a pointer to the Clownfish::Class object of the method’s class, +the second is the unshortened name of the method wrapper. +If short names for the Clownfish parcel are used, +the macro is also available under the name <code>METHOD_PTR</code>.</p> + +<p>To lookup methods from a superclass, +there’s a macro <code>CFISH_SUPER_METHOD_PTR</code> with the same parameters.</p> + +<p>Example using short names:</p> + +<pre>// Note that the name of the method wrapper must not be shortened. +VisGraph_Add_Node_t add_node + = METHOD_PTR(VISIBILITYGRAPH, Pfind_VisGraph_Add_Node); + +VisGraph_Add_Node_t super_add_node + = SUPER_METHOD_PTR(VISIBILITYGRAPH, Pfind_VisGraph_Add_Node);</pre> + +<h4><a class='u' +name="Abstract_methods" +>Abstract methods</a></h4> + +<p>For abstract methods, +the Clownfish compiler generates an implementing function which throws an error. +They should be overridden in a subclass.</p> + +<h4><a class='u' +name="Final_methods" +>Final methods</a></h4> + +<p>Final methods must not be overridden. +They must not be abstract.</p> + +<h4><a class='u' +name="Nullable_return_type" +>Nullable return type</a></h4> + +<p>If a function has a nullable return type, +it must return a pointer. +Non-nullable functions must never return the NULL pointer.</p> + +<h4><a class='u' +name="Incremented_return_type" +>Incremented return type</a></h4> + +<p>Incremented return types must be pointers to Clownfish objects. +The function will either return a new object with an initial reference count of 1 or increment the reference count. +The caller must decrement the reference count of the returned object when it’s no longer used.</p> + +<p>For returned objects with non-incremented return type, +usually no additional handling of reference counts is required. +Only if an object is returned from an accessor or a container object and the caller wants to use the object longer than the returning object retains a reference, +it must increment the reference count itself and decrement when the object is no longer used.</p> + +<h4><a class='u' +name="Decremented_parameters" +>Decremented parameters</a></h4> + +<p>Decremented parameters must be pointers to Clownfish objects. +The function will either decrement the reference count of the passed-in object or retain a reference without incrementing the reference count. +If the caller wants to use the passed-in object afterwards, +it usually must increment its reference count before the call and decrement it when it’s no longer used. +If the caller does not make further use of the passed-in object, +it must not decrement its reference count after the call.</p> + +<p>This is typically used in container classes like Vector:</p> + +<pre>String *string = String_newf("Hello"); +Vec_Push(array, (Obj*)string); +// No need to DECREF the string.</pre> + +<h4><a class='u' +name="Default_parameter_values" +>Default parameter values</a></h4> + +<p>Default parameter values can be given as integer, +float, +or string literals. +The values <code>true</code>, +<code>false</code>, +and <code>NULL</code> are also supported. +The default values are only used by certain host language bindings. +They’re not supported when calling a function from C.</p> + +<h3><a class='u' +name="C_blocks" +>C blocks</a></h3> + +<p>Clownfish headers can contain C blocks which start with a line containing the string <code>__C__</code> and end on a line containing the string <code>__END_C__</code>. +The contents of a C block are copied verbatim to the generated C header.</p> + +<p>Example:</p> + +<pre>__C__ + +struct pfind_AuxiliaryStruct { + int a; + int b; +}; + +__END_C__</pre> + +<h3><a class='u' +name="Object_life_cycle" +>Object life cycle</a></h3> + +<h4><a class='u' +name="Object_creation" +>Object creation</a></h4> + +<p>Objects are allocated by invoking the <code>Make_Obj</code> method on a class’s Clownfish::Class object.</p> + +<p>Any inert function can be used to construct objects from C. +But to support inheritance and object creation from the host language, +Clownfish classes need a separate function to initialize objects. +The initializer must take a pointer to an object as first argument and return a pointer to the same object. +If the parent class has an initializer, +it should be called first by the subclass’s initializer.</p> + +<p>By convention, +the standard constructor is named <code>new</code> and the standard initializer <code>init</code>.</p> + +<p>Example:</p> + +<pre>/* Clownfish header */ + +class Vehicle { + double max_speed; + + inert Vehicle* + init(Vehicle *self, double max_speed); +} + +class Train inherits Vehicle { + double track_gauge; + + inert incremented Train* + new(double max_speed, double track_gauge); + + inert Train* + init(Train *self, double max_speed, double track_gauge); +} + +/* Implementation */ + +Train* +Train_new(double max_speed, double track_gauge) { + Train *self = (Train*)Class_Make_Obj(TRAIN); + return Train_init(self, max_speed, track_gauge); +} + +Train* +Train_init(Train *self, double max_speed, double track_gauge) { + Vehicle_init((Vehicle*)self, max_speed); + self->track_gauge = track_gauge; + return self; +}</pre> + +<h4><a class='u' +name="Reference_counting" +>Reference counting</a></h4> + +<p>Clownfish uses reference counting for memory management. +Objects are created with a reference count of 1. +There are two macros <code>CFISH_INCREF</code> and <code>CFISH_DECREF</code> to increment and decrement reference counts. +If short names for the Clownfish parcel are enabled, +the macros can be abbreviated to <code>INCREF</code> and <code>DECREF</code>. +Both macros take a pointer to an object as argument. +NULL pointers are allowed. +<code>CFISH_INCREF</code> returns a pointer to the object. +This value might differ from the passed-in pointer in some cases. +So if a reference is retained, +the pointer returned from <code>CFISH_INCREF</code> should be used. +<code>CFISH_DECREF</code> returns the modified reference count.</p> + +<p>Examples:</p> + +<pre>self->value = INCREF(arg); + +DECREF(object);</pre> + +<h4><a class='u' +name="Object_destruction" +>Object destruction</a></h4> + +<p>If an object’s reference count reaches 0, +its <code>Destroy</code> method is called. +This public method takes no arguments besides <code>self</code> and has no return value. +It should release the resources held by the object and finally call the <code>Destroy</code> method of the superclass via the <code>CFISH_SUPER_DESTROY</code> macro with short name <code>SUPER_DESTROY</code>. +This macro takes the <code>self</code> pointer as first argument and a pointer to the object’s Clownfish::Class as second argument. +The <code>Destroy</code> method of the Clownfish::Obj class will eventually free the object struct.</p> + +<p>Example:</p> + +<pre>/* Clownfish header */ + +class Path { + Vector *nodes; + + public void + Destroy(Path *self); +} + +/* Implementation */ + +void +Path_Destroy_IMP(Path *self) { + DECREF(self->nodes); + SUPER_DESTROY(self, PATH); +}</pre> + +<h3><a class='u' +name="Documentation" +>Documentation</a></h3> + +<p>The Clownfish compiler creates documentation in the host language’s preferred format from so-called DocuComments found in the <code>.cfh</code> files. +DocuComments use Markdown (<a href="http://commonmark.org/" class="podlinkurl" +>CommonMark</a> flavor) for formatting. +DocuComments are multi-line C-style comments that start with <code>/**</code>. +They immediately precede the documented class, +inert function, +or method. +A left border consisting of whitespace and asterisks is stripped.</p> + +<p>The DocuComment for a class should start with a short description (everything up until the first period <code>.</code>) which may appear in the name section of a man page, +for example.</p> + +<p>DocuComments for functions and methods may end with a series of <code>@param</code> and <code>@return</code> directives which document the parameters and return values.</p> + +<p>Example:</p> + +<pre>/** Class describing a train. + * + * The Train class describes a train. It extends the Vehicle class and + * adds some useful properties specific to trains. + */ +public class Train inherits Vehicle { + /** Create a new Train object. + * + * @param max_speed The maximum speed in km/h. + * @param track_gauge The track gauge in mm. + */ + public inert incremented Train* + new(double max_speed, double track_gauge); + + /** Accessor for maximum speed. + * + * @return the maximum speed in km/h. + */ + public double + Get_Max_Speed(Train *self); +}</pre> + +<p>The Clownfish compiler also looks for standalone Markdown <code>.md</code> files in the source directories which will be included in the documentation.</p> + +</div> + + </div> <!-- lucy-main_content_box --> + <div class="clear"></div> + + </div> <!-- lucy-main_content --> + + <div id="lucy-copyright" class="container_16"> + <p>Copyright © 2010-2015 The Apache Software Foundation, Licensed under the + <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. + <br/> + Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The + Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their + respective owners. + </p> + </div> <!-- lucy-copyright --> + + </div> <!-- lucy-rigid_wrapper --> + + </body> +</html>
Added: websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Err.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Err.html (added) +++ websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Err.html Wed Sep 28 12:07:48 2016 @@ -0,0 +1,161 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Clownfish::Err â Apache Clownfish Documentation</title> + <link rel="stylesheet" type="text/css" media="screen" href="/css/lucy.css"> + </head> + + <body> + + <div id="lucy-rigid_wrapper"> + + <div id="lucy-top" class="container_16 lucy-white_box_3d"> + + <div id="lucy-logo_box" class="grid_8"> + <a href="/"><img src="/images/lucy_logo_150x100.png" alt="Apache Lucyâ¢"></a> + </div> <!-- lucy-logo_box --> + + <div #id="lucy-top_nav_box" class="grid_8"> + <div id="lucy-top_nav_bar" class="container_8"> + <ul> + <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li> + <li><a href="http://www.apache.org/licenses/" title="License">License</a></li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li> + <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li> + <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li> + </ul> + </div> <!-- lucy-top_nav_bar --> + <p><a href="http://www.apache.org/">Apache</a> » <a href="/">Lucy</a> » <a href="/docs/">Docs</a> » <a href="/docs/0.5.0/">0.5.0</a> » <a href="/docs/0.5.0/perl/">Perl</a> » <a href="/docs/0.5.0/perl/Clownfish/">Clownfish</a></p> + <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get"> + <input value="*.apache.org" name="sitesearch" type="hidden"/> + <input type="text" name="q" id="query" style="width:85%"> + <input type="submit" id="submit" value="Search"> + </form> + </div> <!-- lucy-top_nav_box --> + + <div class="clear"></div> + + </div> <!-- lucy-top --> + + <div id="lucy-main_content" class="container_16 lucy-white_box_3d"> + + <div class="grid_4" id="lucy-left_nav_box"> + <h6>About</h6> + <ul> + <li><a href="/">Welcome</a></li> + <li><a href="/clownfish.html">Clownfish</a></li> + <li><a href="/faq.html">FAQ</a></li> + <li><a href="/people.html">People</a></li> + </ul> + <h6>Resources</h6> + <ul> + <li><a href="/download.html">Download</a></li> + <li><a href="/mailing_lists.html">Mailing Lists</a></li> + <li><a href="/docs/">Documentation</a></li> + <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li> + <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li> + <li><a href="/version_control.html">Version Control</a></li> + </ul> + <h6>Related Projects</h6> + <ul> + <li><a href="http://lucene.apache.org/core/">Lucene</a></li> + <li><a href="http://dezi.org/">Dezi</a></li> + <li><a href="http://lucene.apache.org/solr/">Solr</a></li> + <li><a href="http://lucenenet.apache.org/">Lucene.NET</a></li> + <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li> + </ul> + </div> <!-- lucy-left_nav_box --> + + <div id="lucy-main_content_box" class="grid_9"> + <div> +<a name='___top' class='dummyTopAnchor' ></a> + +<h2><a class='u' +name="NAME" +>NAME</a></h2> + +<p>Clownfish::Err - Exception.</p> + +<h2><a class='u' +name="SYNOPSIS" +>SYNOPSIS</a></h2> + +<pre>package MyErr; +use base qw( Clownfish::Err ); + +... + +package main; +use Scalar::Util qw( blessed ); +while (1) { + eval { + do_stuff() or MyErr->throw("retry"); + }; + if ( blessed($@) and $@->isa("MyErr") ) { + warn "Retrying...\n"; + } + else { + # Re-throw. + die "do_stuff() died: $@"; + } +}</pre> + +<h2><a class='u' +name="DESCRIPTION" +>DESCRIPTION</a></h2> + +<p>Clownfish::Err is the base class for exceptions in the Clownfish object hierarchy.</p> + +<p>The Err module also provides access to a per-thread Err shared variable via set_error() and get_error(). +It may be used to store an Err object temporarily, +so that calling code may choose how to handle a particular error condition.</p> + +<h2><a class='u' +name="METHODS" +>METHODS</a></h2> + +<h3><a class='u' +name="cat_mess" +>cat_mess</a></h3> + +<pre>$err->cat_mess($mess);</pre> + +<p>Concatenate the supplied argument onto the error message.</p> + +<h3><a class='u' +name="get_mess" +>get_mess</a></h3> + +<pre>my $string = $err->get_mess();</pre> + +<p>Return the error message.</p> + +<h2><a class='u' +name="INHERITANCE" +>INHERITANCE</a></h2> + +<p>Clownfish::Err isa <a href="../Clownfish/Obj.html" class="podlinkpod" +>Clownfish::Obj</a>.</p> + +</div> + + </div> <!-- lucy-main_content_box --> + <div class="clear"></div> + + </div> <!-- lucy-main_content --> + + <div id="lucy-copyright" class="container_16"> + <p>Copyright © 2010-2015 The Apache Software Foundation, Licensed under the + <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. + <br/> + Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The + Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their + respective owners. + </p> + </div> <!-- lucy-copyright --> + + </div> <!-- lucy-rigid_wrapper --> + + </body> +</html> Added: websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Float.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Float.html (added) +++ websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Float.html Wed Sep 28 12:07:48 2016 @@ -0,0 +1,179 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Clownfish::Float â Apache Clownfish Documentation</title> + <link rel="stylesheet" type="text/css" media="screen" href="/css/lucy.css"> + </head> + + <body> + + <div id="lucy-rigid_wrapper"> + + <div id="lucy-top" class="container_16 lucy-white_box_3d"> + + <div id="lucy-logo_box" class="grid_8"> + <a href="/"><img src="/images/lucy_logo_150x100.png" alt="Apache Lucyâ¢"></a> + </div> <!-- lucy-logo_box --> + + <div #id="lucy-top_nav_box" class="grid_8"> + <div id="lucy-top_nav_bar" class="container_8"> + <ul> + <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li> + <li><a href="http://www.apache.org/licenses/" title="License">License</a></li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li> + <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li> + <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li> + </ul> + </div> <!-- lucy-top_nav_bar --> + <p><a href="http://www.apache.org/">Apache</a> » <a href="/">Lucy</a> » <a href="/docs/">Docs</a> » <a href="/docs/0.5.0/">0.5.0</a> » <a href="/docs/0.5.0/perl/">Perl</a> » <a href="/docs/0.5.0/perl/Clownfish/">Clownfish</a></p> + <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get"> + <input value="*.apache.org" name="sitesearch" type="hidden"/> + <input type="text" name="q" id="query" style="width:85%"> + <input type="submit" id="submit" value="Search"> + </form> + </div> <!-- lucy-top_nav_box --> + + <div class="clear"></div> + + </div> <!-- lucy-top --> + + <div id="lucy-main_content" class="container_16 lucy-white_box_3d"> + + <div class="grid_4" id="lucy-left_nav_box"> + <h6>About</h6> + <ul> + <li><a href="/">Welcome</a></li> + <li><a href="/clownfish.html">Clownfish</a></li> + <li><a href="/faq.html">FAQ</a></li> + <li><a href="/people.html">People</a></li> + </ul> + <h6>Resources</h6> + <ul> + <li><a href="/download.html">Download</a></li> + <li><a href="/mailing_lists.html">Mailing Lists</a></li> + <li><a href="/docs/">Documentation</a></li> + <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li> + <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li> + <li><a href="/version_control.html">Version Control</a></li> + </ul> + <h6>Related Projects</h6> + <ul> + <li><a href="http://lucene.apache.org/core/">Lucene</a></li> + <li><a href="http://dezi.org/">Dezi</a></li> + <li><a href="http://lucene.apache.org/solr/">Solr</a></li> + <li><a href="http://lucenenet.apache.org/">Lucene.NET</a></li> + <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li> + </ul> + </div> <!-- lucy-left_nav_box --> + + <div id="lucy-main_content_box" class="grid_9"> + <div> +<a name='___top' class='dummyTopAnchor' ></a> + +<h2><a class='u' +name="NAME" +>NAME</a></h2> + +<p>Clownfish::Float - Immutable double precision floating point number.</p> + +<h2><a class='u' +name="SYNOPSIS" +>SYNOPSIS</a></h2> + +<pre>my $float = Clownfish::Float->new(2.5); +my $value = $float->get_value;</pre> + +<h2><a class='u' +name="DESCRIPTION" +>DESCRIPTION</a></h2> + +<h2><a class='u' +name="CONSTRUCTORS" +>CONSTRUCTORS</a></h2> + +<h3><a class='u' +name="new" +>new</a></h3> + +<pre>my $float = Clownfish::Float->new($value);</pre> + +<p>Return a new Float.</p> + +<ul> +<li><b>value</b> - Initial value.</li> +</ul> + +<h2><a class='u' +name="METHODS" +>METHODS</a></h2> + +<h3><a class='u' +name="get_value" +>get_value</a></h3> + +<pre>my $result = $float->get_value();</pre> + +<p>Return the value of the Float.</p> + +<h3><a class='u' +name="to_i64" +>to_i64</a></h3> + +<pre>my $int = $float->to_i64();</pre> + +<p>Convert the Float to an integer, +truncating toward zero. +Throw an exception if the value is out of the range of an <code>int64_t</code>.</p> + +<h3><a class='u' +name="compare_to" +>compare_to</a></h3> + +<pre>my $int = $float->compare_to($other);</pre> + +<p>Indicate whether one number is less than, +equal to, +or greater than another. +Throws an exception if <code>other</code> is neither a Float nor an Integer.</p> + +<p>Returns: 0 if the numbers are equal, +a negative number if <code>self</code> is less than <code>other</code>, +and a positive number if <code>self</code> is greater than <code>other</code>.</p> + +<h3><a class='u' +name="clone" +>clone</a></h3> + +<pre>my $result = $float->clone();</pre> + +<p>Return a clone of the object.</p> + +<h2><a class='u' +name="INHERITANCE" +>INHERITANCE</a></h2> + +<p>Clownfish::Float isa <a href="../Clownfish/Obj.html" class="podlinkpod" +>Clownfish::Obj</a>.</p> + +</div> + + </div> <!-- lucy-main_content_box --> + <div class="clear"></div> + + </div> <!-- lucy-main_content --> + + <div id="lucy-copyright" class="container_16"> + <p>Copyright © 2010-2015 The Apache Software Foundation, Licensed under the + <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. + <br/> + Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The + Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their + respective owners. + </p> + </div> <!-- lucy-copyright --> + + </div> <!-- lucy-rigid_wrapper --> + + </body> +</html> Added: websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Hash.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Hash.html (added) +++ websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Hash.html Wed Sep 28 12:07:48 2016 @@ -0,0 +1,212 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Clownfish::Hash â Apache Clownfish Documentation</title> + <link rel="stylesheet" type="text/css" media="screen" href="/css/lucy.css"> + </head> + + <body> + + <div id="lucy-rigid_wrapper"> + + <div id="lucy-top" class="container_16 lucy-white_box_3d"> + + <div id="lucy-logo_box" class="grid_8"> + <a href="/"><img src="/images/lucy_logo_150x100.png" alt="Apache Lucyâ¢"></a> + </div> <!-- lucy-logo_box --> + + <div #id="lucy-top_nav_box" class="grid_8"> + <div id="lucy-top_nav_bar" class="container_8"> + <ul> + <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li> + <li><a href="http://www.apache.org/licenses/" title="License">License</a></li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li> + <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li> + <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li> + </ul> + </div> <!-- lucy-top_nav_bar --> + <p><a href="http://www.apache.org/">Apache</a> » <a href="/">Lucy</a> » <a href="/docs/">Docs</a> » <a href="/docs/0.5.0/">0.5.0</a> » <a href="/docs/0.5.0/perl/">Perl</a> » <a href="/docs/0.5.0/perl/Clownfish/">Clownfish</a></p> + <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get"> + <input value="*.apache.org" name="sitesearch" type="hidden"/> + <input type="text" name="q" id="query" style="width:85%"> + <input type="submit" id="submit" value="Search"> + </form> + </div> <!-- lucy-top_nav_box --> + + <div class="clear"></div> + + </div> <!-- lucy-top --> + + <div id="lucy-main_content" class="container_16 lucy-white_box_3d"> + + <div class="grid_4" id="lucy-left_nav_box"> + <h6>About</h6> + <ul> + <li><a href="/">Welcome</a></li> + <li><a href="/clownfish.html">Clownfish</a></li> + <li><a href="/faq.html">FAQ</a></li> + <li><a href="/people.html">People</a></li> + </ul> + <h6>Resources</h6> + <ul> + <li><a href="/download.html">Download</a></li> + <li><a href="/mailing_lists.html">Mailing Lists</a></li> + <li><a href="/docs/">Documentation</a></li> + <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li> + <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li> + <li><a href="/version_control.html">Version Control</a></li> + </ul> + <h6>Related Projects</h6> + <ul> + <li><a href="http://lucene.apache.org/core/">Lucene</a></li> + <li><a href="http://dezi.org/">Dezi</a></li> + <li><a href="http://lucene.apache.org/solr/">Solr</a></li> + <li><a href="http://lucenenet.apache.org/">Lucene.NET</a></li> + <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li> + </ul> + </div> <!-- lucy-left_nav_box --> + + <div id="lucy-main_content_box" class="grid_9"> + <div> +<a name='___top' class='dummyTopAnchor' ></a> + +<h2><a class='u' +name="NAME" +>NAME</a></h2> + +<p>Clownfish::Hash - Hashtable.</p> + +<h2><a class='u' +name="SYNOPSIS" +>SYNOPSIS</a></h2> + +<pre>my $hash = Clownfish::Hash->new; +$hash->store($key, $value); +my $value = $hash->fetch($key);</pre> + +<h2><a class='u' +name="DESCRIPTION" +>DESCRIPTION</a></h2> + +<p>Values are stored by reference and may be any kind of Obj.</p> + +<h2><a class='u' +name="CONSTRUCTORS" +>CONSTRUCTORS</a></h2> + +<h3><a class='u' +name="new" +>new</a></h3> + +<pre>my $hash = Clownfish::Hash->new( + capacity => $capacity # default: 0 +);</pre> + +<p>Return a new Hash.</p> + +<ul> +<li><b>capacity</b> - The number of elements that the hash will be asked to hold initially.</li> +</ul> + +<h2><a class='u' +name="METHODS" +>METHODS</a></h2> + +<h3><a class='u' +name="clear" +>clear</a></h3> + +<pre>$hash->clear();</pre> + +<p>Empty the hash of all key-value pairs.</p> + +<h3><a class='u' +name="store" +>store</a></h3> + +<pre>$hash->store($key, $value);</pre> + +<p>Store a key-value pair.</p> + +<h3><a class='u' +name="fetch" +>fetch</a></h3> + +<pre>my $obj = $hash->fetch($key);</pre> + +<p>Fetch the value associated with <code>key</code>.</p> + +<p>Returns: the value, +or undef if <code>key</code> is not present.</p> + +<h3><a class='u' +name="delete" +>delete</a></h3> + +<pre>my $obj = $hash->delete($key);</pre> + +<p>Attempt to delete a key-value pair from the hash.</p> + +<p>Returns: the value if <code>key</code> exists and thus deletion succeeds; otherwise undef.</p> + +<h3><a class='u' +name="has_key" +>has_key</a></h3> + +<pre>my $bool = $hash->has_key($key);</pre> + +<p>Indicate whether the supplied <code>key</code> is present.</p> + +<h3><a class='u' +name="keys" +>keys</a></h3> + +<pre>my $arrayref = $hash->keys();</pre> + +<p>Return the Hash’s keys.</p> + +<h3><a class='u' +name="values" +>values</a></h3> + +<pre>my $arrayref = $hash->values();</pre> + +<p>Return the Hash’s values.</p> + +<h3><a class='u' +name="get_size" +>get_size</a></h3> + +<pre>my $int = $hash->get_size();</pre> + +<p>Return the number of key-value pairs.</p> + +<h2><a class='u' +name="INHERITANCE" +>INHERITANCE</a></h2> + +<p>Clownfish::Hash isa <a href="../Clownfish/Obj.html" class="podlinkpod" +>Clownfish::Obj</a>.</p> + +</div> + + </div> <!-- lucy-main_content_box --> + <div class="clear"></div> + + </div> <!-- lucy-main_content --> + + <div id="lucy-copyright" class="container_16"> + <p>Copyright © 2010-2015 The Apache Software Foundation, Licensed under the + <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. + <br/> + Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The + Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their + respective owners. + </p> + </div> <!-- lucy-copyright --> + + </div> <!-- lucy-rigid_wrapper --> + + </body> +</html> Added: websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/HashIterator.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/HashIterator.html (added) +++ websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/HashIterator.html Wed Sep 28 12:07:48 2016 @@ -0,0 +1,168 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Clownfish::HashIterator â Apache Clownfish Documentation</title> + <link rel="stylesheet" type="text/css" media="screen" href="/css/lucy.css"> + </head> + + <body> + + <div id="lucy-rigid_wrapper"> + + <div id="lucy-top" class="container_16 lucy-white_box_3d"> + + <div id="lucy-logo_box" class="grid_8"> + <a href="/"><img src="/images/lucy_logo_150x100.png" alt="Apache Lucyâ¢"></a> + </div> <!-- lucy-logo_box --> + + <div #id="lucy-top_nav_box" class="grid_8"> + <div id="lucy-top_nav_bar" class="container_8"> + <ul> + <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li> + <li><a href="http://www.apache.org/licenses/" title="License">License</a></li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li> + <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li> + <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li> + </ul> + </div> <!-- lucy-top_nav_bar --> + <p><a href="http://www.apache.org/">Apache</a> » <a href="/">Lucy</a> » <a href="/docs/">Docs</a> » <a href="/docs/0.5.0/">0.5.0</a> » <a href="/docs/0.5.0/perl/">Perl</a> » <a href="/docs/0.5.0/perl/Clownfish/">Clownfish</a></p> + <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get"> + <input value="*.apache.org" name="sitesearch" type="hidden"/> + <input type="text" name="q" id="query" style="width:85%"> + <input type="submit" id="submit" value="Search"> + </form> + </div> <!-- lucy-top_nav_box --> + + <div class="clear"></div> + + </div> <!-- lucy-top --> + + <div id="lucy-main_content" class="container_16 lucy-white_box_3d"> + + <div class="grid_4" id="lucy-left_nav_box"> + <h6>About</h6> + <ul> + <li><a href="/">Welcome</a></li> + <li><a href="/clownfish.html">Clownfish</a></li> + <li><a href="/faq.html">FAQ</a></li> + <li><a href="/people.html">People</a></li> + </ul> + <h6>Resources</h6> + <ul> + <li><a href="/download.html">Download</a></li> + <li><a href="/mailing_lists.html">Mailing Lists</a></li> + <li><a href="/docs/">Documentation</a></li> + <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li> + <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li> + <li><a href="/version_control.html">Version Control</a></li> + </ul> + <h6>Related Projects</h6> + <ul> + <li><a href="http://lucene.apache.org/core/">Lucene</a></li> + <li><a href="http://dezi.org/">Dezi</a></li> + <li><a href="http://lucene.apache.org/solr/">Solr</a></li> + <li><a href="http://lucenenet.apache.org/">Lucene.NET</a></li> + <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li> + </ul> + </div> <!-- lucy-left_nav_box --> + + <div id="lucy-main_content_box" class="grid_9"> + <div> +<a name='___top' class='dummyTopAnchor' ></a> + +<h2><a class='u' +name="NAME" +>NAME</a></h2> + +<p>Clownfish::HashIterator - Hashtable Iterator.</p> + +<h2><a class='u' +name="SYNOPSIS" +>SYNOPSIS</a></h2> + +<pre>my $iter = Clownfish::HashIterator->new($hash); +while ($iter->next) { + my $key = $iter->get_key; + my $value = $iter->get_value; +}</pre> + +<h2><a class='u' +name="DESCRIPTION" +>DESCRIPTION</a></h2> + +<h2><a class='u' +name="CONSTRUCTORS" +>CONSTRUCTORS</a></h2> + +<h3><a class='u' +name="new" +>new</a></h3> + +<pre>my $iter = Clownfish::HashIterator->new($hash);</pre> + +<p>Return a HashIterator for <code>hash</code>.</p> + +<h2><a class='u' +name="METHODS" +>METHODS</a></h2> + +<h3><a class='u' +name="next" +>next</a></h3> + +<pre>my $bool = $hash_iterator->next();</pre> + +<p>Advance the iterator to the next key-value pair.</p> + +<p>Returns: true if there’s another key-value pair, +false if the iterator is exhausted.</p> + +<h3><a class='u' +name="get_key" +>get_key</a></h3> + +<pre>my $string = $hash_iterator->get_key();</pre> + +<p>Return the key of the current key-value pair. +It’s not allowed to call this method before <a href="#next" class="podlinkpod" +>next()</a> was called for the first time or after the iterator was exhausted.</p> + +<h3><a class='u' +name="get_value" +>get_value</a></h3> + +<pre>my $obj = $hash_iterator->get_value();</pre> + +<p>Return the value of the current key-value pair. +It’s not allowed to call this method before <a href="#next" class="podlinkpod" +>next()</a> was called for the first time or after the iterator was exhausted.</p> + +<h2><a class='u' +name="INHERITANCE" +>INHERITANCE</a></h2> + +<p>Clownfish::HashIterator isa <a href="../Clownfish/Obj.html" class="podlinkpod" +>Clownfish::Obj</a>.</p> + +</div> + + </div> <!-- lucy-main_content_box --> + <div class="clear"></div> + + </div> <!-- lucy-main_content --> + + <div id="lucy-copyright" class="container_16"> + <p>Copyright © 2010-2015 The Apache Software Foundation, Licensed under the + <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. + <br/> + Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The + Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their + respective owners. + </p> + </div> <!-- lucy-copyright --> + + </div> <!-- lucy-rigid_wrapper --> + + </body> +</html> Added: websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Integer.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Integer.html (added) +++ websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Integer.html Wed Sep 28 12:07:48 2016 @@ -0,0 +1,177 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Clownfish::Integer â Apache Clownfish Documentation</title> + <link rel="stylesheet" type="text/css" media="screen" href="/css/lucy.css"> + </head> + + <body> + + <div id="lucy-rigid_wrapper"> + + <div id="lucy-top" class="container_16 lucy-white_box_3d"> + + <div id="lucy-logo_box" class="grid_8"> + <a href="/"><img src="/images/lucy_logo_150x100.png" alt="Apache Lucyâ¢"></a> + </div> <!-- lucy-logo_box --> + + <div #id="lucy-top_nav_box" class="grid_8"> + <div id="lucy-top_nav_bar" class="container_8"> + <ul> + <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li> + <li><a href="http://www.apache.org/licenses/" title="License">License</a></li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li> + <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li> + <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li> + </ul> + </div> <!-- lucy-top_nav_bar --> + <p><a href="http://www.apache.org/">Apache</a> » <a href="/">Lucy</a> » <a href="/docs/">Docs</a> » <a href="/docs/0.5.0/">0.5.0</a> » <a href="/docs/0.5.0/perl/">Perl</a> » <a href="/docs/0.5.0/perl/Clownfish/">Clownfish</a></p> + <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get"> + <input value="*.apache.org" name="sitesearch" type="hidden"/> + <input type="text" name="q" id="query" style="width:85%"> + <input type="submit" id="submit" value="Search"> + </form> + </div> <!-- lucy-top_nav_box --> + + <div class="clear"></div> + + </div> <!-- lucy-top --> + + <div id="lucy-main_content" class="container_16 lucy-white_box_3d"> + + <div class="grid_4" id="lucy-left_nav_box"> + <h6>About</h6> + <ul> + <li><a href="/">Welcome</a></li> + <li><a href="/clownfish.html">Clownfish</a></li> + <li><a href="/faq.html">FAQ</a></li> + <li><a href="/people.html">People</a></li> + </ul> + <h6>Resources</h6> + <ul> + <li><a href="/download.html">Download</a></li> + <li><a href="/mailing_lists.html">Mailing Lists</a></li> + <li><a href="/docs/">Documentation</a></li> + <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li> + <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li> + <li><a href="/version_control.html">Version Control</a></li> + </ul> + <h6>Related Projects</h6> + <ul> + <li><a href="http://lucene.apache.org/core/">Lucene</a></li> + <li><a href="http://dezi.org/">Dezi</a></li> + <li><a href="http://lucene.apache.org/solr/">Solr</a></li> + <li><a href="http://lucenenet.apache.org/">Lucene.NET</a></li> + <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li> + </ul> + </div> <!-- lucy-left_nav_box --> + + <div id="lucy-main_content_box" class="grid_9"> + <div> +<a name='___top' class='dummyTopAnchor' ></a> + +<h2><a class='u' +name="NAME" +>NAME</a></h2> + +<p>Clownfish::Integer - Immutable 64-bit signed integer.</p> + +<h2><a class='u' +name="SYNOPSIS" +>SYNOPSIS</a></h2> + +<pre>my $integer = Clownfish::Integer->new(7); +my $value = $integer->get_value;</pre> + +<h2><a class='u' +name="DESCRIPTION" +>DESCRIPTION</a></h2> + +<h2><a class='u' +name="CONSTRUCTORS" +>CONSTRUCTORS</a></h2> + +<h3><a class='u' +name="new" +>new</a></h3> + +<pre>my $integer = Clownfish::Integer->new($value);</pre> + +<p>Return a new Integer.</p> + +<ul> +<li><b>value</b> - Initial value.</li> +</ul> + +<h2><a class='u' +name="METHODS" +>METHODS</a></h2> + +<h3><a class='u' +name="get_value" +>get_value</a></h3> + +<pre>my $int = $integer->get_value();</pre> + +<p>Return the value of the Integer.</p> + +<h3><a class='u' +name="to_f64" +>to_f64</a></h3> + +<pre>my $float = $integer->to_f64();</pre> + +<p>Convert the Integer to floating point.</p> + +<h3><a class='u' +name="compare_to" +>compare_to</a></h3> + +<pre>my $int = $integer->compare_to($other);</pre> + +<p>Indicate whether one number is less than, +equal to, +or greater than another. +Throws an exception if <code>other</code> is neither an Integer nor a Float.</p> + +<p>Returns: 0 if the numbers are equal, +a negative number if <code>self</code> is less than <code>other</code>, +and a positive number if <code>self</code> is greater than <code>other</code>.</p> + +<h3><a class='u' +name="clone" +>clone</a></h3> + +<pre>my $result = $integer->clone();</pre> + +<p>Return a clone of the object.</p> + +<h2><a class='u' +name="INHERITANCE" +>INHERITANCE</a></h2> + +<p>Clownfish::Integer isa <a href="../Clownfish/Obj.html" class="podlinkpod" +>Clownfish::Obj</a>.</p> + +</div> + + </div> <!-- lucy-main_content_box --> + <div class="clear"></div> + + </div> <!-- lucy-main_content --> + + <div id="lucy-copyright" class="container_16"> + <p>Copyright © 2010-2015 The Apache Software Foundation, Licensed under the + <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. + <br/> + Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The + Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their + respective owners. + </p> + </div> <!-- lucy-copyright --> + + </div> <!-- lucy-rigid_wrapper --> + + </body> +</html> Added: websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Obj.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Obj.html (added) +++ websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/Obj.html Wed Sep 28 12:07:48 2016 @@ -0,0 +1,251 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Clownfish::Obj â Apache Clownfish Documentation</title> + <link rel="stylesheet" type="text/css" media="screen" href="/css/lucy.css"> + </head> + + <body> + + <div id="lucy-rigid_wrapper"> + + <div id="lucy-top" class="container_16 lucy-white_box_3d"> + + <div id="lucy-logo_box" class="grid_8"> + <a href="/"><img src="/images/lucy_logo_150x100.png" alt="Apache Lucyâ¢"></a> + </div> <!-- lucy-logo_box --> + + <div #id="lucy-top_nav_box" class="grid_8"> + <div id="lucy-top_nav_bar" class="container_8"> + <ul> + <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li> + <li><a href="http://www.apache.org/licenses/" title="License">License</a></li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li> + <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li> + <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li> + </ul> + </div> <!-- lucy-top_nav_bar --> + <p><a href="http://www.apache.org/">Apache</a> » <a href="/">Lucy</a> » <a href="/docs/">Docs</a> » <a href="/docs/0.5.0/">0.5.0</a> » <a href="/docs/0.5.0/perl/">Perl</a> » <a href="/docs/0.5.0/perl/Clownfish/">Clownfish</a></p> + <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get"> + <input value="*.apache.org" name="sitesearch" type="hidden"/> + <input type="text" name="q" id="query" style="width:85%"> + <input type="submit" id="submit" value="Search"> + </form> + </div> <!-- lucy-top_nav_box --> + + <div class="clear"></div> + + </div> <!-- lucy-top --> + + <div id="lucy-main_content" class="container_16 lucy-white_box_3d"> + + <div class="grid_4" id="lucy-left_nav_box"> + <h6>About</h6> + <ul> + <li><a href="/">Welcome</a></li> + <li><a href="/clownfish.html">Clownfish</a></li> + <li><a href="/faq.html">FAQ</a></li> + <li><a href="/people.html">People</a></li> + </ul> + <h6>Resources</h6> + <ul> + <li><a href="/download.html">Download</a></li> + <li><a href="/mailing_lists.html">Mailing Lists</a></li> + <li><a href="/docs/">Documentation</a></li> + <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li> + <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li> + <li><a href="/version_control.html">Version Control</a></li> + </ul> + <h6>Related Projects</h6> + <ul> + <li><a href="http://lucene.apache.org/core/">Lucene</a></li> + <li><a href="http://dezi.org/">Dezi</a></li> + <li><a href="http://lucene.apache.org/solr/">Solr</a></li> + <li><a href="http://lucenenet.apache.org/">Lucene.NET</a></li> + <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li> + </ul> + </div> <!-- lucy-left_nav_box --> + + <div id="lucy-main_content_box" class="grid_9"> + <div> +<a name='___top' class='dummyTopAnchor' ></a> + +<h2><a class='u' +name="NAME" +>NAME</a></h2> + +<p>Clownfish::Obj - Base class for all objects.</p> + +<h2><a class='u' +name="SYNOPSIS" +>SYNOPSIS</a></h2> + +<pre>package MyObj; +use base qw( Clownfish::Obj ); + +# Inside-out member var. +my %foo; + +sub new { + my ( $class, %args ) = @_; + my $foo = delete $args{foo}; + my $self = $class->SUPER::new(%args); + $foo{$$self} = $foo; + return $self; +} + +sub get_foo { + my $self = shift; + return $foo{$$self}; +} + +sub DESTROY { + my $self = shift; + delete $foo{$$self}; + $self->SUPER::DESTROY; +}</pre> + +<h2><a class='u' +name="DESCRIPTION" +>DESCRIPTION</a></h2> + +<p>Clownfish::Obj is the base class of the Clownfish object hierarchy.</p> + +<p>From the standpoint of a Perl programmer, +all classes are implemented as blessed scalar references, +with the scalar storing a pointer to a C struct.</p> + +<h3><a class='u' +name="Subclassing" +>Subclassing</a></h3> + +<p>The recommended way to subclass Clownfish::Obj and its descendants is to use the inside-out design pattern. +(See <a href="../Class/InsideOut.html" class="podlinkpod" +>Class::InsideOut</a> for an introduction to inside-out techniques.)</p> + +<p>Since the blessed scalar stores a C pointer value which is unique per-object, +<code>$$self</code> can be used as an inside-out ID.</p> + +<pre># Accessor for 'foo' member variable. +sub get_foo { + my $self = shift; + return $foo{$$self}; +}</pre> + +<p>Caveats:</p> + +<ul> +<li>Inside-out aficionados will have noted that the "cached scalar id" stratagem recommended above isn't compatible with ithreads.</li> + +<li>Overridden methods must not return undef unless the API specifies that returning undef is permissible.</li> +</ul> + +<h2><a class='u' +name="CONSTRUCTOR" +>CONSTRUCTOR</a></h2> + +<h3><a class='u' +name="new" +>new</a></h3> + +<pre>my $self = $class->SUPER::new;</pre> + +<p>Abstract constructor -- must be invoked via a subclass. +Attempting to instantiate objects of class "Clownfish::Obj" directly causes an error.</p> + +<p>Takes no arguments; if any are supplied, +an error will be reported.</p> + +<h2><a class='u' +name="ABSTRACT_METHODS" +>ABSTRACT METHODS</a></h2> + +<h3><a class='u' +name="clone" +>clone</a></h3> + +<pre>my $result = $obj->clone();</pre> + +<p>Return a clone of the object.</p> + +<h3><a class='u' +name="compare_to" +>compare_to</a></h3> + +<pre>my $int = $obj->compare_to($other);</pre> + +<p>Indicate whether one object is less than, +equal to, +or greater than another.</p> + +<ul> +<li><b>other</b> - Another Obj.</li> +</ul> + +<p>Returns: 0 if the objects are equal, +a negative number if <code>self</code> is less than <code>other</code>, +and a positive number if <code>self</code> is greater than <code>other</code>.</p> + +<h2><a class='u' +name="METHODS" +>METHODS</a></h2> + +<h3><a class='u' +name="to_perl" +>to_perl</a></h3> + +<pre>my $native = $obj->to_perl;</pre> + +<p>Tries to convert the object to its native Perl representation.</p> + +<h3><a class='u' +name="equals" +>equals</a></h3> + +<pre>my $bool = $obj->equals($other);</pre> + +<p>Indicate whether two objects are the same. +By default, +compares the memory address.</p> + +<ul> +<li><b>other</b> - Another Obj.</li> +</ul> + +<h3><a class='u' +name="DESTROY" +>DESTROY</a></h3> + +<p>All Clownfish classes implement a DESTROY method; if you override it in a subclass, +you must call <code>$self->SUPER::DESTROY</code> to avoid leaking memory.</p> + +<h3><a class='u' +name="to_string" +>to_string</a></h3> + +<pre>my $string = $obj->to_string();</pre> + +<p>Generic stringification: “ClassName@hex_mem_address”.</p> + +</div> + + </div> <!-- lucy-main_content_box --> + <div class="clear"></div> + + </div> <!-- lucy-main_content --> + + <div id="lucy-copyright" class="container_16"> + <p>Copyright © 2010-2015 The Apache Software Foundation, Licensed under the + <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. + <br/> + Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The + Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their + respective owners. + </p> + </div> <!-- lucy-copyright --> + + </div> <!-- lucy-rigid_wrapper --> + + </body> +</html> Added: websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/String.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/String.html (added) +++ websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/String.html Wed Sep 28 12:07:48 2016 @@ -0,0 +1,339 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Clownfish::String â Apache Clownfish Documentation</title> + <link rel="stylesheet" type="text/css" media="screen" href="/css/lucy.css"> + </head> + + <body> + + <div id="lucy-rigid_wrapper"> + + <div id="lucy-top" class="container_16 lucy-white_box_3d"> + + <div id="lucy-logo_box" class="grid_8"> + <a href="/"><img src="/images/lucy_logo_150x100.png" alt="Apache Lucyâ¢"></a> + </div> <!-- lucy-logo_box --> + + <div #id="lucy-top_nav_box" class="grid_8"> + <div id="lucy-top_nav_bar" class="container_8"> + <ul> + <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li> + <li><a href="http://www.apache.org/licenses/" title="License">License</a></li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li> + <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li> + <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li> + </ul> + </div> <!-- lucy-top_nav_bar --> + <p><a href="http://www.apache.org/">Apache</a> » <a href="/">Lucy</a> » <a href="/docs/">Docs</a> » <a href="/docs/0.5.0/">0.5.0</a> » <a href="/docs/0.5.0/perl/">Perl</a> » <a href="/docs/0.5.0/perl/Clownfish/">Clownfish</a></p> + <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get"> + <input value="*.apache.org" name="sitesearch" type="hidden"/> + <input type="text" name="q" id="query" style="width:85%"> + <input type="submit" id="submit" value="Search"> + </form> + </div> <!-- lucy-top_nav_box --> + + <div class="clear"></div> + + </div> <!-- lucy-top --> + + <div id="lucy-main_content" class="container_16 lucy-white_box_3d"> + + <div class="grid_4" id="lucy-left_nav_box"> + <h6>About</h6> + <ul> + <li><a href="/">Welcome</a></li> + <li><a href="/clownfish.html">Clownfish</a></li> + <li><a href="/faq.html">FAQ</a></li> + <li><a href="/people.html">People</a></li> + </ul> + <h6>Resources</h6> + <ul> + <li><a href="/download.html">Download</a></li> + <li><a href="/mailing_lists.html">Mailing Lists</a></li> + <li><a href="/docs/">Documentation</a></li> + <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li> + <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li> + <li><a href="/version_control.html">Version Control</a></li> + </ul> + <h6>Related Projects</h6> + <ul> + <li><a href="http://lucene.apache.org/core/">Lucene</a></li> + <li><a href="http://dezi.org/">Dezi</a></li> + <li><a href="http://lucene.apache.org/solr/">Solr</a></li> + <li><a href="http://lucenenet.apache.org/">Lucene.NET</a></li> + <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li> + </ul> + </div> <!-- lucy-left_nav_box --> + + <div id="lucy-main_content_box" class="grid_9"> + <div> +<a name='___top' class='dummyTopAnchor' ></a> + +<h2><a class='u' +name="NAME" +>NAME</a></h2> + +<p>Clownfish::String - Immutable string holding Unicode characters.</p> + +<h2><a class='u' +name="SYNOPSIS" +>SYNOPSIS</a></h2> + +<pre>my $string = Clownfish::String->new('abc'); +print $string->to_perl, "\n";</pre> + +<h2><a class='u' +name="DESCRIPTION" +>DESCRIPTION</a></h2> + +<h2><a class='u' +name="CONSTRUCTORS" +>CONSTRUCTORS</a></h2> + +<h3><a class='u' +name="new" +>new</a></h3> + +<pre>my $string = Clownfish::String->new($perl_string);</pre> + +<p>Return a String containing the passed-in Perl string.</p> + +<h2><a class='u' +name="METHODS" +>METHODS</a></h2> + +<h3><a class='u' +name="cat" +>cat</a></h3> + +<pre>my $result = $string->cat($other);</pre> + +<p>Return the concatenation of the String and <code>other</code>.</p> + +<h3><a class='u' +name="to_i64" +>to_i64</a></h3> + +<pre>my $int = $string->to_i64();</pre> + +<p>Extract a 64-bit integer from a decimal string. +See <a href="#basex_to_i64" class="podlinkpod" +>basex_to_i64()</a> for details.</p> + +<h3><a class='u' +name="basex_to_i64" +>basex_to_i64</a></h3> + +<pre>my $int = $string->basex_to_i64($base);</pre> + +<p>Extract a 64-bit integer from a variable-base stringified version. +Expects an optional minus sign followed by base-x digits, +stopping at any non-digit character. +Returns zero if no digits are found. +If the value exceeds the range of an <code>int64_t</code>, +the result is undefined.</p> + +<ul> +<li><b>base</b> - A base between 2 and 36.</li> +</ul> + +<h3><a class='u' +name="to_f64" +>to_f64</a></h3> + +<pre>my $float = $string->to_f64();</pre> + +<p>Convert a string to a floating-point number using the C library function <code>strtod</code>.</p> + +<h3><a class='u' +name="starts_with" +>starts_with</a></h3> + +<pre>my $bool = $string->starts_with($prefix);</pre> + +<p>Test whether the String starts with <code>prefix</code>.</p> + +<h3><a class='u' +name="ends_with" +>ends_with</a></h3> + +<pre>my $bool = $string->ends_with($suffix);</pre> + +<p>Test whether the String ends with <code>suffix</code>.</p> + +<h3><a class='u' +name="contains" +>contains</a></h3> + +<pre>my $bool = $string->contains($substring);</pre> + +<p>Test whether the String contains <code>substring</code>.</p> + +<h3><a class='u' +name="find" +>find</a></h3> + +<pre>my $string_iterator = $string->find($substring);</pre> + +<p>Return a <a href="../Clownfish/StringIterator.html" class="podlinkpod" +>StringIterator</a> pointing to the first occurrence of <code>substring</code> within the String, +or undef if the substring does not match.</p> + +<h3><a class='u' +name="length" +>length</a></h3> + +<pre>my $int = $string->length();</pre> + +<p>Return the number of Unicode code points the String contains.</p> + +<h3><a class='u' +name="get_size" +>get_size</a></h3> + +<pre>my $int = $string->get_size();</pre> + +<p>Return the number of bytes occupied by the String’s internal content.</p> + +<h3><a class='u' +name="to_bytebuf" +>to_bytebuf</a></h3> + +<pre>my $byte_buf = $string->to_bytebuf();</pre> + +<p>Return a ByteBuf which holds a copy of the String.</p> + +<h3><a class='u' +name="clone" +>clone</a></h3> + +<pre>my $result = $string->clone();</pre> + +<p>Return a clone of the object.</p> + +<h3><a class='u' +name="compare_to" +>compare_to</a></h3> + +<pre>my $int = $string->compare_to($other);</pre> + +<p>Indicate whether one String is less than, +equal to, +or greater than another. +The Unicode code points of the Strings are compared lexicographically. +Throws an exception if <code>other</code> is not a String.</p> + +<p>Returns: 0 if the Strings are equal, +a negative number if <code>self</code> is less than <code>other</code>, +and a positive number if <code>self</code> is greater than <code>other</code>.</p> + +<h3><a class='u' +name="trim" +>trim</a></h3> + +<pre>my $result = $string->trim();</pre> + +<p>Return a copy of the String with Unicode whitespace characters removed from both top and tail. +Whitespace is any character that has the Unicode property <code>White_Space</code>.</p> + +<h3><a class='u' +name="trim_top" +>trim_top</a></h3> + +<pre>my $result = $string->trim_top();</pre> + +<p>Return a copy of the String with leading Unicode whitespace removed. +Whitespace is any character that has the Unicode property <code>White_Space</code>.</p> + +<h3><a class='u' +name="trim_tail" +>trim_tail</a></h3> + +<pre>my $result = $string->trim_tail();</pre> + +<p>Return a copy of the String with trailing Unicode whitespace removed. +Whitespace is any character that has the Unicode property <code>White_Space</code>.</p> + +<h3><a class='u' +name="code_point_at" +>code_point_at</a></h3> + +<pre>my $int = $string->code_point_at($tick);</pre> + +<p>Return the Unicode code point located <code>tick</code> code points in from the top. +Return <code>CFISH_STR_OOB</code> if out of bounds.</p> + +<h3><a class='u' +name="code_point_from" +>code_point_from</a></h3> + +<pre>my $int = $string->code_point_from($tick);</pre> + +<p>Return the Unicode code point located <code>tick</code> code points counting backwards from the end. +Return <code>CFISH_STR_OOB</code> if out of bounds.</p> + +<h3><a class='u' +name="substring" +>substring</a></h3> + +<pre>my $result = $string->substring( + offset => $offset # required + length => $length # required +);</pre> + +<p>Return a new substring containing a copy of the specified range.</p> + +<ul> +<li><b>offset</b> - Offset from the top, +in code points.</li> + +<li><b>length</b> - The desired length of the substring, +in code points.</li> +</ul> + +<h3><a class='u' +name="top" +>top</a></h3> + +<pre>my $string_iterator = $string->top();</pre> + +<p>Return an iterator initialized to the start of the string.</p> + +<h3><a class='u' +name="tail" +>tail</a></h3> + +<pre>my $string_iterator = $string->tail();</pre> + +<p>Return an iterator initialized to the end of the string.</p> + +<h2><a class='u' +name="INHERITANCE" +>INHERITANCE</a></h2> + +<p>Clownfish::String isa <a href="../Clownfish/Obj.html" class="podlinkpod" +>Clownfish::Obj</a>.</p> + +</div> + + </div> <!-- lucy-main_content_box --> + <div class="clear"></div> + + </div> <!-- lucy-main_content --> + + <div id="lucy-copyright" class="container_16"> + <p>Copyright © 2010-2015 The Apache Software Foundation, Licensed under the + <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. + <br/> + Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The + Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their + respective owners. + </p> + </div> <!-- lucy-copyright --> + + </div> <!-- lucy-rigid_wrapper --> + + </body> +</html> Added: websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/StringIterator.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/StringIterator.html (added) +++ websites/staging/lucy/trunk/content/docs/0.5.0/perl/Clownfish/StringIterator.html Wed Sep 28 12:07:48 2016 @@ -0,0 +1,259 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Clownfish::StringIterator â Apache Clownfish Documentation</title> + <link rel="stylesheet" type="text/css" media="screen" href="/css/lucy.css"> + </head> + + <body> + + <div id="lucy-rigid_wrapper"> + + <div id="lucy-top" class="container_16 lucy-white_box_3d"> + + <div id="lucy-logo_box" class="grid_8"> + <a href="/"><img src="/images/lucy_logo_150x100.png" alt="Apache Lucyâ¢"></a> + </div> <!-- lucy-logo_box --> + + <div #id="lucy-top_nav_box" class="grid_8"> + <div id="lucy-top_nav_bar" class="container_8"> + <ul> + <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li> + <li><a href="http://www.apache.org/licenses/" title="License">License</a></li> + <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li> + <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li> + <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li> + </ul> + </div> <!-- lucy-top_nav_bar --> + <p><a href="http://www.apache.org/">Apache</a> » <a href="/">Lucy</a> » <a href="/docs/">Docs</a> » <a href="/docs/0.5.0/">0.5.0</a> » <a href="/docs/0.5.0/perl/">Perl</a> » <a href="/docs/0.5.0/perl/Clownfish/">Clownfish</a></p> + <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get"> + <input value="*.apache.org" name="sitesearch" type="hidden"/> + <input type="text" name="q" id="query" style="width:85%"> + <input type="submit" id="submit" value="Search"> + </form> + </div> <!-- lucy-top_nav_box --> + + <div class="clear"></div> + + </div> <!-- lucy-top --> + + <div id="lucy-main_content" class="container_16 lucy-white_box_3d"> + + <div class="grid_4" id="lucy-left_nav_box"> + <h6>About</h6> + <ul> + <li><a href="/">Welcome</a></li> + <li><a href="/clownfish.html">Clownfish</a></li> + <li><a href="/faq.html">FAQ</a></li> + <li><a href="/people.html">People</a></li> + </ul> + <h6>Resources</h6> + <ul> + <li><a href="/download.html">Download</a></li> + <li><a href="/mailing_lists.html">Mailing Lists</a></li> + <li><a href="/docs/">Documentation</a></li> + <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li> + <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li> + <li><a href="/version_control.html">Version Control</a></li> + </ul> + <h6>Related Projects</h6> + <ul> + <li><a href="http://lucene.apache.org/core/">Lucene</a></li> + <li><a href="http://dezi.org/">Dezi</a></li> + <li><a href="http://lucene.apache.org/solr/">Solr</a></li> + <li><a href="http://lucenenet.apache.org/">Lucene.NET</a></li> + <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li> + </ul> + </div> <!-- lucy-left_nav_box --> + + <div id="lucy-main_content_box" class="grid_9"> + <div> +<a name='___top' class='dummyTopAnchor' ></a> + +<h2><a class='u' +name="NAME" +>NAME</a></h2> + +<p>Clownfish::StringIterator - Iterate Unicode code points in a String.</p> + +<h2><a class='u' +name="SYNOPSIS" +>SYNOPSIS</a></h2> + +<pre>my $iter = $string->top; +while (my $code_point = $iter->next) { + ... +}</pre> + +<h2><a class='u' +name="DESCRIPTION" +>DESCRIPTION</a></h2> + +<h2><a class='u' +name="METHODS" +>METHODS</a></h2> + +<h3><a class='u' +name="clone" +>clone</a></h3> + +<pre>my $result = $string_iterator->clone();</pre> + +<p>Return a clone of the object.</p> + +<h3><a class='u' +name="assign" +>assign</a></h3> + +<pre>$string_iterator->assign($other);</pre> + +<p>Assign the source string and current position of <code>other</code> to <code>self</code>.</p> + +<h3><a class='u' +name="compare_to" +>compare_to</a></h3> + +<pre>my $int = $string_iterator->compare_to($other);</pre> + +<p>Indicate whether one StringIterator is less than, +equal to, +or greater than another by comparing their character positions. +Throws an exception if <code>other</code> is not a StringIterator pointing to the same source string as <code>self</code>.</p> + +<p>Returns: 0 if the StringIterators are equal, +a negative number if <code>self</code> is less than <code>other</code>, +and a positive number if <code>self</code> is greater than <code>other</code>.</p> + +<h3><a class='u' +name="has_next" +>has_next</a></h3> + +<pre>my $bool = $string_iterator->has_next();</pre> + +<p>Return true if the iterator is not at the end of the string.</p> + +<h3><a class='u' +name="has_prev" +>has_prev</a></h3> + +<pre>my $bool = $string_iterator->has_prev();</pre> + +<p>Return true if the iterator is not at the start of the string.</p> + +<h3><a class='u' +name="next" +>next</a></h3> + +<pre>my $code_point = $iter->next;</pre> + +<p>Return the code point after the current position and advance the iterator. +Returns undef at the end of the string. +Returns zero but true for U+0000.</p> + +<h3><a class='u' +name="prev" +>prev</a></h3> + +<pre>my $code_point = $iter->prev;</pre> + +<p>Return the code point before the current position and go one step back. +Returns undef at the start of the string. +Returns zero but true for U+0000.</p> + +<h3><a class='u' +name="advance" +>advance</a></h3> + +<pre>my $int = $string_iterator->advance($num);</pre> + +<p>Skip code points.</p> + +<ul> +<li><b>num</b> - The number of code points to skip.</li> +</ul> + +<p>Returns: the number of code points actually skipped. +This can be less than the requested number if the end of the string is reached.</p> + +<h3><a class='u' +name="recede" +>recede</a></h3> + +<pre>my $int = $string_iterator->recede($num);</pre> + +<p>Skip code points backward.</p> + +<ul> +<li><b>num</b> - The number of code points to skip.</li> +</ul> + +<p>Returns: the number of code points actually skipped. +This can be less than the requested number if the start of the string is reached.</p> + +<h3><a class='u' +name="skip_whitespace" +>skip_whitespace</a></h3> + +<pre>my $int = $string_iterator->skip_whitespace();</pre> + +<p>Skip whitespace. +Whitespace is any character that has the Unicode property <code>White_Space</code>.</p> + +<p>Returns: the number of code points skipped.</p> + +<h3><a class='u' +name="skip_whitespace_back" +>skip_whitespace_back</a></h3> + +<pre>my $int = $string_iterator->skip_whitespace_back();</pre> + +<p>Skip whitespace backward. +Whitespace is any character that has the Unicode property <code>White_Space</code>.</p> + +<p>Returns: the number of code points skipped.</p> + +<h3><a class='u' +name="starts_with" +>starts_with</a></h3> + +<pre>my $bool = $string_iterator->starts_with($prefix);</pre> + +<p>Test whether the content after the iterator starts with <code>prefix</code>.</p> + +<h3><a class='u' +name="ends_with" +>ends_with</a></h3> + +<pre>my $bool = $string_iterator->ends_with($suffix);</pre> + +<p>Test whether the content before the iterator ends with <code>suffix</code>.</p> + +<h2><a class='u' +name="INHERITANCE" +>INHERITANCE</a></h2> + +<p>Clownfish::StringIterator isa <a href="../Clownfish/Obj.html" class="podlinkpod" +>Clownfish::Obj</a>.</p> + +</div> + + </div> <!-- lucy-main_content_box --> + <div class="clear"></div> + + </div> <!-- lucy-main_content --> + + <div id="lucy-copyright" class="container_16"> + <p>Copyright © 2010-2015 The Apache Software Foundation, Licensed under the + <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. + <br/> + Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The + Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their + respective owners. + </p> + </div> <!-- lucy-copyright --> + + </div> <!-- lucy-rigid_wrapper --> + + </body> +</html>