Created
June 29, 2016 21:02
-
-
Save davidtruchet/4c0fbb3a9509bc43a6851a26e52c3655 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void paginateLists() { | |
int careIndex = 0; | |
List<ProductAttributeModel> currentList = new ArrayList<ProductAttributeModel>(); | |
for (ProductAttributeModel productAttributeModel : this.careTextList) { | |
if (careIndex != 0 && careIndex % CARE_PAGE_SIZE == 0) { | |
this.resultCareList.add(currentList); | |
currentList = new ArrayList<ProductAttributeModel>(); | |
} | |
currentList.add(productAttributeModel); | |
careIndex++; | |
} | |
if(!currentList.isEmpty()) { | |
this.resultCareList.add(currentList); | |
} | |
currentList = new ArrayList<ProductAttributeModel>(); | |
int specIndex = 0; | |
for (ProductAttributeModel productAttributeModel : this.populatedSpecList) { | |
if (specIndex != 0 && specIndex % SPECS_PAGE_SIZE == 0) { | |
this.resultSpecList.add(currentList); | |
currentList = new ArrayList<ProductAttributeModel>(); | |
} | |
currentList.add(productAttributeModel); | |
specIndex++; | |
} | |
if(!currentList.isEmpty()) { | |
this.resultSpecList.add(currentList); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment