

Public Member Functions | |
| zItem ($type) | |
| Constructs an Item Node with the Specified data Type. | |
| hasParent () | |
| Checks wheather or not the Current Node has a Parent. | |
| setParent (&$parentNode) | |
| Sets the Parent Node of a Node. | |
| & | getParent () |
| Returns a Reference to the Parent Node. | |
| setData ($val) | |
| Store Data in teh data Block Data Must be of same type as it is Supposed to be. | |
| getData () | |
| Returns teh Data in the data Block. | |
| hasNext () | |
| Checks wheather or not its the Last Item. | |
| setNext ($nextElem) | |
| Sets the Next Element on the link Block returns False also fires Error if the next element is not of zItem Class Type. | |
| & | getNext () |
| Get the next Eelement. | |
| removeNext () | |
| Removes the Link. | |
| getType () | |
| retrns teh TypeId used in this Node | |
| isDataValid ($type) | |
| Checks Wheather or not the Current Node Contains a Valid Type Safe Data in Its Data Block. | |
| isValid ($type) | |
| Checks wheather this Node as well as the Child Nodes are Valid Recursively. | |
Data Fields | |
| $type | |
| $data | |
| $link = null | |
| $parent = null | |
Definition at line 15 of file zitem.php.
| zItem::zItem | ( | $ | type | ) |
Constructs an Item Node with the Specified data Type.
e.g. If its a Node of String you can only attach a String Node as teh next Item in teh link Block
| $type | String |
Definition at line 51 of file zitem.php.
References $type.
Referenced by zList::addData(), and zVect::insert().
00051 { 00052 $this->type = $type; 00053 }
| zItem::hasParent | ( | ) |
| zItem::setParent | ( | &$ | parentNode | ) |
Sets the Parent Node of a Node.
| $parentNode | zItem |
Definition at line 67 of file zitem.php.
References getType(), ofPolymorphicType(), perror(), and typeId().
00067 { 00068 if(!ofPolymorphicType($parentNode, 'zItem')){ 00069 perror("<code>zigmoyd.common.zItem.setParent()</code><br />parentItem is not of zItem Class Type instead its a ".typeId($parentNode)." Type So It Cannot be linked with a zItem Object"); 00070 return false; 00071 } 00072 if(!(strtolower($this->getType()) == strtolower($nextElem->getType()))){ 00073 perror("<code>zigmoyd.common.zItem.setParent()</code><br />parentItem Node is not of same Type of this Item Node<br />Expecting ".$this->getType()." But getting ".$parentNode->getType()); 00074 return false; 00075 } 00076 $this->parent = $parentNode; 00077 return true; 00078 }

| & zItem::getParent | ( | ) |
| zItem::setData | ( | $ | val | ) |
Store Data in teh data Block Data Must be of same type as it is Supposed to be.
| $val | mixed |
Definition at line 93 of file zitem.php.
References $val, ofType(), perror(), and typeId().
00093 { 00094 if(ofType($val, $this->type)){ 00095 $this->data = $val; 00096 return true; 00097 } 00098 perror("<code>zigmoyd.common.zItem.setData($val)</code><br />DataType Mismatch. Expecting value of Type $this->type But ".typeId($val)." Type value Given.<br />Not setting the Data in teh Data Block"); 00099 return false; 00100 }

| zItem::getData | ( | ) |
| zItem::hasNext | ( | ) |
Checks wheather or not its the Last Item.
Definition at line 114 of file zitem.php.
Referenced by zList::addData(), zVect::at(), zVect::dataAt(), zVect::detach(), isValid(), and zList::length().
| zItem::setNext | ( | $ | nextElem | ) |
Sets the Next Element on the link Block returns False also fires Error if the next element is not of zItem Class Type.
| $nextElem | zItem |
Definition at line 123 of file zitem.php.
References getType(), ofType(), perror(), and typeId().
00123 { 00124 if(!ofType($nextElem, 'zItem')){ 00125 perror("<code>zigmoyd.common.zItem.setNext()</code><br />nextItem is not of zItem Class Type instead its a ".typeId($nextElem)." Type So It Cannot be linked with a zItem Object"); 00126 return false; 00127 } 00128 if(strtolower($this->getType()) == strtolower($nextElem->getType())){ 00129 $nextElem->setParent($this); 00130 $this->link = $nextElem; 00131 return true; 00132 } 00133 perror("<code>zigmoyd.common.zItem.setNext()</code><br />nextItem Node is not of same Type of this Item Node<br />Expecting ".$this->getType()." But getting ".$nextElem->getType()); 00134 return false; 00135 }

| & zItem::getNext | ( | ) |
Get the next Eelement.
Definition at line 141 of file zitem.php.
Referenced by zVect::at(), and zVect::dataAt().
| zItem::removeNext | ( | ) |
| zItem::getType | ( | ) |
retrns teh TypeId used in this Node
Definition at line 157 of file zitem.php.
Referenced by setNext(), and setParent().
| zItem::isDataValid | ( | $ | type | ) |
| zItem::isValid | ( | $ | type | ) |
Checks wheather this Node as well as the Child Nodes are Valid Recursively.
| $type | String |
Definition at line 175 of file zitem.php.
References $type, hasNext(), and isDataValid().
00175 { 00176 if($this->isDataValid($type)){ 00177 if($this->hasNext()){ 00178 return $this->isValid($this->type); 00179 } 00180 return true; 00181 } 00182 return false; 00183 }

| zItem::$type |
Definition at line 22 of file zitem.php.
Referenced by isDataValid(), isValid(), zItem(), and zList::zList().
1.5.6