Loading Please wait...

OOPS data structures.


Data Structures

class  zItem
 zItem Class Constructs a Node of a Linked List or a tree More...
class  zList
 Linked List Class. More...
class  zTree
class  zVect
 Implementation of Vector by Using Linked List. More...
class  zVectIterator

Functions

 typeId ($var)
 ofType ($var, $typeName)
 ofPolymorphicType ($var, $className)

Detailed Description

This Module fullfills the necessity of Object Oriented approach to different Data Structure. Which can be used if required. such as Linked list, Tree, Vector. Map etc..

Function Documentation

ofPolymorphicType ( var,
className 
)

Checks wheather the Object is of given Polymorphic type or not. e.g. you can use it like ofPolymorphicType('zigController', 'zCore');

Parameters:
$var mixed the variable who's datatype you want to know.
$typeName string datatype with Which you want to match/compare
Returns:
boolean

Definition at line 34 of file type.php.

References typeId().

Referenced by zItem::setParent().

00034                                             {
00035   if($classType = get_class($var)){
00036     if($className == $classType)return true;
00037     //{ get Parent Class's List of $var
00038     $parentClassList = array();
00039     $parentClassName = get_class($var);
00040     while($parentClassName = get_parent_class($parentClassName)){
00041       $parentClassList[] = strtolower($parentClassName);
00042     }
00043     //}
00044     return in_array(strtolower($className), $parentClassList);
00045   }else{
00046     return (strtolower(typeId($var)) == strtolower($className));
00047   }
00048 }

Here is the call graph for this function:

ofType ( var,
typeName 
)

Checks wheather the variable is of given datatype or not. e.g. you can use it like ofType("Hello World", "string")

Parameters:
$var mixed the variable who's datatype you want to know.
$typeName string datatype with Which you want to match/compare
Returns:
boolean

Definition at line 24 of file type.php.

References typeId().

Referenced by zItem::setData(), and zItem::setNext().

00024                                 {
00025   return (strtolower(typeId($var)) == strtolower($typeName));
00026 }

Here is the call graph for this function:

typeId ( var  ) 

Returns the datatype of a Variable as a String.

Parameters:
$var mixed the variable who's datatype you want to know.
Returns:
string.

Definition at line 13 of file type.php.

Referenced by zItem::isDataValid(), ofPolymorphicType(), ofType(), zItem::setData(), zItem::setNext(), and zItem::setParent().

00013                      {
00014   if($classType = get_class($var))return $classType;
00015   return gettype($var);
00016 }


Generated on Mon Oct 27 23:52:54 2008 for zigmoyd.kdevelop by doxygen 1.5.6