commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Antonio Pérez Testa <japte...@indra.es>
Subject Re: Collections HowTo
Date Wed, 18 Aug 2004 15:08:07 GMT
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: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>    
>>
-------------------------------------------------------------------------------------------------------------------
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: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message