MatchGroup Class Reference

Inheritance diagram for MatchGroup:

MatchInterface

List of all members.

Public Member Functions

 __construct ()
 setMatchName (MatchName $objMatchName)
 getMatchName ()
 setMatchRegularExpression (MatchRegularExpression $objMatchName)
 getMatchRegularExpression ()
 setNotFoundValue ($objNotFoundValue)
 getNotFoundValue ()
 addItemName ($strItemName, $objValue=null)
 addItemRegularExpression ($strItemRegex, $objValue=null)
 match ($strName)
 found ($strName)
 isEmpty ()

Protected Attributes

 $objMatchName
 $objMatchRegularExpression
 $objNotFoundValue = false


Detailed Description

Definition at line 32 of file MatchGroup.class.php.


Constructor & Destructor Documentation

__construct (  ) 

constructor of the group

Definition at line 59 of file MatchGroup.class.php.

00060     {
00061         $this->objMatchName = new MatchName();
00062         $this->objMatchRegularExpression = new MatchRegularExpression();
00063     }


Member Function Documentation

addItemName ( strItemName,
objValue = null 
)

proxy to add item into the match name

Parameters:
string $strItemName
object $objValue
Returns:
MatchGroup

Definition at line 140 of file MatchGroup.class.php.

References getMatchName().

00141     {
00142         $this->getMatchName()->addItem( $strItemName , $objValue );
00143         return $this;
00144     }

addItemRegularExpression ( strItemRegex,
objValue = null 
)

proxy to add item into the match regular expression

Parameters:
string $strItemRegex
object $objValue
Returns:
MatchGroup

Definition at line 153 of file MatchGroup.class.php.

References getMatchRegularExpression().

00154     {
00155         $this->getMatchRegularExpression()->addItem( $strItemRegex , $objValue );
00156         return $this;
00157     }

found ( strName  ) 

Found the name into the match group

Parameters:
string $strName
Returns:
boolean

Implements MatchInterface.

Definition at line 185 of file MatchGroup.class.php.

References getMatchName(), and getMatchRegularExpression().

Referenced by match().

00186     {
00187         return
00188         (
00189             ( $this->getMatchName()->found( $strName ) )
00190         ||
00191             ( $this->getMatchRegularExpression()->found( $strName ) )
00192         );
00193     }

getMatchName (  ) 

Get the match name

Returns:
MatchName $objMatchName

Definition at line 82 of file MatchGroup.class.php.

Referenced by addItemName(), found(), isEmpty(), match(), and setNotFoundValue().

00083     {
00084         return $this->objMatchName;
00085     }

getMatchRegularExpression (  ) 

Get the match regular expression

Returns:
MatchName $objMatchRegularExpression

Definition at line 104 of file MatchGroup.class.php.

Referenced by addItemRegularExpression(), found(), isEmpty(), match(), and setNotFoundValue().

00105     {
00106         return $this->objMatchRegularExpression;
00107     }

getNotFoundValue (  ) 

Get the not found value

Returns:
object
$objValue

Implements MatchInterface.

Definition at line 128 of file MatchGroup.class.php.

Referenced by match().

00129     {
00130         return $this->objNotFoundValue;
00131     }

isEmpty (  ) 

Inform if the match inside the group are empty

Returns:
boolean

Definition at line 200 of file MatchGroup.class.php.

References getMatchName(), and getMatchRegularExpression().

00201     {
00202         return
00203         (
00204             ( $this->getMatchName()->isEmpty() )
00205         &&
00206             ( $this->getMatchRegularExpression()->isEmpty() )
00207         );
00208     }

match ( strName  ) 

Match the string name

See also:
MatchName::match( string )

MatchRegularExpression::match( string )

Returns:
object <value>

Implements MatchInterface.

Definition at line 166 of file MatchGroup.class.php.

References found(), getMatchName(), getMatchRegularExpression(), and getNotFoundValue().

00167     {
00168         if( $this->getMatchName()->found( $strName ) )
00169         {
00170             return $this->getMatchName()->match( $strName );
00171         }
00172         if( $this->getMatchRegularExpression()->found( $strName ) )
00173         {
00174             return $this->getMatchRegularExpression()->match( $strName );
00175         }
00176         return $this->getNotFoundValue();
00177     }

setMatchName ( MatchName objMatchName  ) 

Set the match name

Parameters:
MatchName $objMatchName
Returns:
Match

Definition at line 71 of file MatchGroup.class.php.

00072     {
00073         $this->objMatchName = $objMatchName;
00074         return $this;
00075     }

setMatchRegularExpression ( MatchRegularExpression objMatchName  ) 

Set the match regular expression

Parameters:
MatchName $objMatchRegularExpression
Returns:
MatchGroup

Definition at line 93 of file MatchGroup.class.php.

References $objMatchRegularExpression.

00094     {
00095         $this->objMatchRegularExpression = $objMatchRegularExpression;
00096         return $this;
00097     }

setNotFoundValue ( objNotFoundValue  ) 

Set the not found value

Parameters:
object $objValue
Returns:
MatchGroup

Implements MatchInterface.

Definition at line 115 of file MatchGroup.class.php.

References $objNotFoundValue, getMatchName(), and getMatchRegularExpression().

00116     {
00117         $this->objNotFoundValue = $objNotFoundValue;
00118         $this->getMatchName()->setNotFoundValue( $objNotFoundValue );
00119         $this->getMatchRegularExpression()->setNotFoundValue( $objNotFoundValue );
00120         return $this;
00121     }


Member Data Documentation

$objMatchName [protected]

Match Name of the group

MatchName

Definition at line 39 of file MatchGroup.class.php.

$objMatchRegularExpression [protected]

Match Regular Expression of the group

MatchName

Definition at line 46 of file MatchGroup.class.php.

Referenced by setMatchRegularExpression().

$objNotFoundValue = false [protected]

Object to be return when the received <name> unmatch in the match() method

object

Definition at line 54 of file MatchGroup.class.php.

Referenced by setNotFoundValue().


The documentation for this class was generated from the following file:

Generated on Thu Feb 3 03:55:03 2011 for CodeToDiagram by  doxygen 1.5.9