cvs: pear /Math_Vector Tuple.php

From: Date: Wed, 24 Apr 2002 23:39:22 +0000
Subject: cvs: pear /Math_Vector Tuple.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-3528@lists.php.net to get a copy of this message
jmcastagnetto Wed Apr 24 19:39:22 2002 EDT Modified files: /pear/Math_Vector Tuple.php Log: Constructor user a PEAR_Error w/ PEAR_ERROR_DIE mode when failing renamed compact() to squeezeHoles() Index: pear/Math_Vector/Tuple.php diff -u pear/Math_Vector/Tuple.php:1.1 pear/Math_Vector/Tuple.php:1.2 --- pear/Math_Vector/Tuple.php:1.1 Tue Apr 23 18:04:00 2002 +++ pear/Math_Vector/Tuple.php Wed Apr 24 19:39:21 2002 @@ -16,7 +16,7 @@ // | Authors: Jesus M. Castagnetto <jmcastagnetto@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Tuple.php,v 1.1 2002/04/23 22:04:00 jmcastagnetto Exp $ +// $Id: Tuple.php,v 1.2 2002/04/24 23:39:21 jmcastagnetto Exp $ // require_once "PEAR.php"; @@ -53,17 +53,18 @@ if (is_array($data) || !is_array($data[0])) { $this->data = $data; } else { - return new PEAR_Error("An unidimensional array is needed to initialize a Vector"); + new PEAR_Error("An unidimensional array is needed to initialize a Tuple", + null, PEAR_ERROR_DIE); } }/*}}}*/ /** - * Compact the tuple removing holes in the sequence + * Squeezes out holes in the tuple sequence * * @access public * @return void */ - function compact ()/*{{{*/ + function squeezeHoles ()/*{{{*/ { $this->data = explode(":", implode(":",$this->data)); }/*}}}*/ @@ -125,7 +126,7 @@ return new PEAR_Error("Wrong index: $elindex, element not deleted"); } unset($this->data[$elindex]); - $this->compact(); + $this->squeezeHoles(); return true; }/*}}}*/ @@ -152,7 +153,7 @@ */ function getData () /*{{{*/ { - $this->compact(); + $this->squeezeHoles(); return $this->data; }/*}}}*/

« previous php.pear.cvs (#3528) next »