MatchListInterface Interface Reference

Inheritance diagram for MatchListInterface:

MatchInterface MatchName MatchRegularExpression

List of all members.

Public Member Functions

 setDefaultItemValue ($objDefaultItemValue)
 getDefaultItemValue ()
 setItemList (array $arrItemList, $arrValues=null)
 getItemList ()
 addItem ($objItem, $objValue=null)
 isEmpty ()


Detailed Description

Author:
Thiago Henrique Ramos da Mata <thiago.henrique.mata@gmail.com>
Since:
2009-06-16
Define the behavior of one match

The Match Class is feed with a Match Itens, here called as "itens".

The Itens are append to the Match Class to configure it. They are append into it by the MatchListInterface::setItemList() and MatchListInterface::addItem() method.

Each iten can be compared with each name and a boolean result must be extract from this operation.

The mode as each item interact with the name to get the result it is customizable to each implementation of this interface.

When MatchListInterface::found() method be called, the class should compare the name with each item, one by one. Case some compared item returns true, the MatchListInterface::found() method will returns true. Otherwise, the method will returns false.

When MatchListInterface::match() method be called, the class should compare the name with each item, one by one. Case some compared item returns true, the MatchListInterface::match() method will returns the value of this item, what will be the default value if not informed into the MatchListInterface::addItem() method or into the MatchListInterface::setItemList() method. The itens should be checked into the include order. The last add will be the last compared.

Case, after try match the name with all the itens without success, the MatchListInterface::match() should return the NotFoundValue informed into the MatchListInterface::setNotFoundValue().

To know if the match has some filter, the method MatchListInterface::isEmpty() returns true if the list itens has no elements and returns false otherwise.

Definition at line 46 of file MatchListInterface.interface.php.


Member Function Documentation

addItem ( objItem,
objValue = null 
)

Add a item into the item list

Implements:
MatchListInterface::addItem( <item> object [, <value> object ])
See also:
MatchListInterface::setItemList( <item>[] )

MatchListInterface::getItemList()

Parameters:
object $objItem
object $objValue
Returns:
MatchListInterface me

Implemented in MatchName, and MatchRegularExpression.

getDefaultItemValue (  ) 

Get the default item value.

This value <value> what will be saved on some item <item> when this setter dont inform its value

Implements:
MatchListInterface::getDefaultItemValue()
Returns:
object <value>

Implemented in MatchName, and MatchRegularExpression.

getItemList (  ) 

Get the array with the item list into the match

Implements:
MatchListInterface::getItemList()
Returns:
<item>[] $arrItemList

Implemented in MatchName, and MatchRegularExpression.

isEmpty (  ) 

Returns true if the item list is empty returns false if not.

If is empty the match allways will return the not found value

Execution Plan:
  • read the list itens.
  • check if the list is empty
    • returns true if the list is empty
    • returns false if the list is not empty
Implements:
MatchList::isEmpty()
Implements:
MatchListInterface::isEmpty()
Returns:
boolean

Implemented in MatchName, and MatchRegularExpression.

setDefaultItemValue ( objDefaultItemValue  ) 

Set the not found value.

Changing this value will change how the result of the match() method when not item match with the received name

Implements:
MatchListInterface::match( <name> object )
Implements:
MatchList::match( <name> object )
See also:
MatchListInterface::setNotFoundValue( <value> object )
Parameters:
object $objNotFoundValue
Returns:
MatchListInterface me Get the not found value.
This value will be returned when the name received don't match with any element into the item list in the match() method

Implements:
MatchInterface::getNotFoundValue()
Implements:
MatchListInterface::getNotFoundValue()
See also:
MatchListInterface::match( <name> object )
Returns:
object <value> Set the default item value.
Changing this element will change how the value of the itens <item> what not informed they values into the setItemList() and addItem()

Implements:
MatchListInterface::setDefaultItemValue( <value> object )
See also:
MatchListInterface::setItemList( <item>array [, <value>array ] )
Parameters:
object $objNotFoundValue
Returns:
MatchListInterface me

Implemented in MatchName, and MatchRegularExpression.

setItemList ( array $  arrItemList,
arrValues = null 
)

Set the array with the item list into the match. Can receive the array with the values of each item. If the array with values not received, the default value to the itens will be true

Implements:
MatchListInterface::setItemList( <item>[] [ , <value>[] ])
See also:
MatchListInterface::getItemList()
Parameters:
<item>[] $arrItemList
<value>[] $arrValues
Returns:
MatchListInterface me
Exceptions:
MatchException 

Implemented in MatchName, and MatchRegularExpression.


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

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