Monday, March 30, 2009

Concatenate arrays to a List

This is a simple code snippet which explains, how to concatenate two arrays
into a list

private List getChildren(ContextNode parentItem) {
List siblings = null;
siblings = new ArrayList();
Collections.addAll(siblings, ((ContextNode)parentItem).getChildNodes());
Collections.addAll(siblings, ((ContextNode)parentItem).getAttributes());
return siblings;
}

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home