-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
27 additions
and
22 deletions.
There are no files selected for viewing
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
13 changes: 3 additions & 10 deletions
13
api/src/main/java/com/github/skjolber/packing/api/packager/DefaultLoadableItemFilter.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,20 @@ | ||
package com.github.skjolber.packing.api.packager; | ||
import java.util.List; | ||
|
||
public class DefaultLoadableItemFilter implements LoadableItemFilter { | ||
|
||
protected final List<LoadableItem> loadableItems; | ||
protected final LoadableItems loadableItems; | ||
|
||
public DefaultLoadableItemFilter(List<LoadableItem> loadableItems) { | ||
public DefaultLoadableItemFilter(LoadableItems loadableItems) { | ||
this.loadableItems = loadableItems; | ||
} | ||
|
||
@Override | ||
public List<LoadableItem> getLoadableItems() { | ||
return loadableItems; | ||
} | ||
|
||
@Override | ||
public boolean loaded(int index) { | ||
public void loaded(int index) { | ||
LoadableItem loadableItem = loadableItems.get(index); | ||
loadableItem.decrement(); | ||
if(loadableItem.isEmpty()) { | ||
loadableItems.remove(index); | ||
} | ||
return false; | ||
} | ||
|
||
} |
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
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
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
13 changes: 13 additions & 0 deletions
13
api/src/main/java/com/github/skjolber/packing/api/packager/LoadableItems.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.github.skjolber.packing.api.packager; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* | ||
* The items which are available for load into some particular container. | ||
* | ||
*/ | ||
|
||
public interface LoadableItems extends List<LoadableItem>{ | ||
|
||
} |