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;
}
into a list
private List
List
siblings = new ArrayList
Collections.addAll(siblings, ((ContextNode)parentItem).getChildNodes());
Collections.addAll(siblings, ((ContextNode)parentItem).getAttributes());
return siblings;
}
Labels: collection
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home