1. Introduction
This post only gather some references and examples of use of ArrayList in Java2. Examples
- Example #1:
List elementList = new ArrayList();
for (int i = 0; i < nodeList.getLength(); i++) {
Element element = (Element) (Node) nodeList.item(i);
if (element.getAttribute(attribute).equals(attributeValue)) {
elementList.add(element);
}
}
- Example #2:
ArrayList<CellStyle> listCellStyle = new ArrayList<CellStyle>();
// i=0: LEMON_CHIFFON
style = workbook.createCellStyle();
style.setFillForegroundColor(IndexedColors.LEMON_CHIFFON.getIndex());
style.setFillPattern(CellStyle.SOLID_FOREGROUND);
listCellStyle.add(style);
Nenhum comentário:
Postar um comentário