How can I empty the attributeList every time it has "added" the value to largeAttributeList?. I've tried .clear() but then the largeAttributeList loses all the values.
ArrayList<String> attributeList = new ArrayList<String>();
ArrayList<ArrayList<String>> largeAttributeList = new
ArrayList<ArrayList<String>>();
for (int i = 0; i < attribute.getLength(); i++) {
String current = attribute.item(i).getTextContent();
if(current.equals("Identifier")){
largeAttributeList.add(attributeList);
}
else{
attributeList.add(current);
}
}