All that concepts are imported into java from Functional Programming Languages such as Prolog or CAML.

IMHO they give a hand when working with Collections extracting the process out of the loop.
For example, if you want to add all the elements of a List you only have to define the add process and delegate to the Functor the loop itself.
When you have a list of some type and need a list of some other type objects you only define the Transformer,
and if you want to select objects from a Collection based on some criteria, you have to code the criteria , pass it to a Functor and you'll have in return a new list with ONLY those objects.


Is another just another look into programming!

Leandro Rodrigo Saad Cruz wrote:

What is the concept behind Functor/Predicate/Transformer ?

On Wed, 2004-08-18 at 10:44, matthew.hawthorne wrote:


Leandro Rodrigo Saad Cruz wrote:


Hi all. Any directions on how to use Functors and Predicates ?


Hmm... maybe read the Javadoc?

It's hard to respond to such a vague question, do you have a more specific problem you're trying to solve?

Basically, there are methods in CollectionUtils that take a collection and a Functor/Predicate/Transformer as a parameter.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-------------------------------------------------------------------------------------------------------------------
Este correo electr�nico y, en su caso, cualquier fichero anexo al mismo, contiene 
informaci�n de car�cter confidencial exclusivamente dirigida a su destinatario o 
destinatarios. Queda prohibida su divulgaci�n, copia o distribuci�n a terceros sin la 
previa autorizaci�n escrita de Indra. En el caso de haber recibido este correo 
electr�nico por error, se ruega notificar inmediatamente esta circunstancia mediante 
reenv�o a la direcci�n electr�nica del remitente.

The information in this e-mail and in any attachments is confidential and solely for 
the attention and use of the named addressee(s). You are hereby notified that any 
dissemination, distribution or copy of this communication is prohibited without the 
prior written consent of Indra. If you have received this communication in error, 
please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to