concept projecting in category java

appears as: Projecting
Struts 2 in Action

This is an excerpt from Manning's book Struts 2 in Action.

Filtering and Projecting Collections

OGNL supports a couple of special operations that you can conduct on your collections. Filtering allows you to take a collection of objects and filter them according to some rule. For instance, you could take a set of users and filter them down to only those who’re more than 20 years old. Projection, on the other hand, allows you to transform a collection of objects according to some rule. For instance, you could take a set of user objects, having both first and last name properties, and transform it into a set of String objects that combines the first and last name of each user into a single string. To clarify, filtering takes a Collection of size N and produces a new collection containing a subset of those elements ranging from size 0 to size N. On the other hand, projecting always produces a Collection with exactly the same number of elements as the original Collection; projecting produces a one-for-one result set.