Spring Inline lists

Inline lists 


Lists can be expressed directly in an expression using {} notation.

// evaluates to a Java list containing the four numbers

List numbers = (List) parser.parseExpression("{1,2,3,4}").getValue(context); 
List listOfLists = (List) parser.parseExpression("{{'a','b'},{'x','y'}}").getValue(context); 

{} by itself means an empty list. For performance reasons, if the list is itself entirely composed of fixed literals then a constant list is created to represent the expression, rather than building a new list on each evaluation. 

Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept