Created
June 6, 2019 12:48
-
-
Save MwBakker/0cbc015566bc4432a477452eb5cb518b 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
// manually sets the storage to storageUI | |
private List<UIStorage> createStorageUIList(List<Storage> storageUnits, Executor executor) | |
{ | |
List<UIStorage> UIStorageList = new ArrayList<>(); | |
for (Storage storage : storageUnits) | |
{ | |
executor.execute(() -> | |
{ | |
UIStorageList.add(createUIStorage(storage)); | |
}); | |
} | |
return UIStorageList; | |
} | |
// returns one storage unit | |
public UIStorage getUIStorageUnit(long id) | |
{ | |
return createUIStorage(getDao().getStorageUnit(id)); | |
} | |
// returns uiStorage from storage | |
private UIStorage createUIStorage(Storage storage) | |
{ | |
UIStorage uiStorage = new UIStorage(storage.id, storage.getName(), storage.getLocation(), storage.getImgPath()); | |
uiStorage.setAmountOfRacks(getDao().getAmountOfRacks(storage.id)); | |
uiStorage.setAmountOfComponents(getDao().getAmountOfComponents(storage.id)); | |
return uiStorage; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment