아래 ArrayList는 크기 부분의 2 차원 ArrayList입니다. storeIds를 ArrayList의 일부로 나누고 2D ArrayList의 내부 ArrayList에 추가합니다. partStoreIds
이기 때문에,2 차원 ArrayList의 내부 ArrayList를 초기화하는 방법
partStoreIds.add(new ArrayList<>(storeIds.subList(querySize*i, maxIndex)));
사실 :
ArrayList<ArrayList<String>> partStoreIds = new ArrayList<ArrayList<String>>(parts);
for(int i = 0; i < parts; i++)
{
System.out.println("Executing part: " + i);
int maxIndex = Math.min(storeIds.size(), querySize*(i+1));
//The below line is throwing an exception
partStoreIds.addAll(storeIds.subList(querySize*i, maxIndex));
}
전체 스택 추적을 게시하시기 바랍니다. 또한'storeIds'에 어떤 유형이 있습니까? – Turing85
현재 접근 방식에있어 문제점은 무엇입니까? –
@ Turing85에 대해 유감스럽게 생각합니다. storeIds 유형 목록입니다 –
kai