-
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
23 changed files
with
218 additions
and
305 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
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
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
77 changes: 77 additions & 0 deletions
77
api/src/main/java/com/github/skjolber/packing/api/packager/BoundedStackable.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,77 @@ | ||
package com.github.skjolber.packing.api.packager; | ||
|
||
import com.github.skjolber.packing.api.StackValue; | ||
import com.github.skjolber.packing.api.Stackable; | ||
|
||
/** | ||
* | ||
* Stackable item which fit within certain bounds, i.e. load dimensions of a container. | ||
* | ||
*/ | ||
|
||
public class BoundedStackable extends Stackable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
protected final StackValue[] values; | ||
protected final Stackable stackable; | ||
|
||
protected final long minimumArea; | ||
protected final long maximumArea; | ||
|
||
public BoundedStackable(Stackable stackable, StackValue[] stackValues) { | ||
this.values = stackValues; | ||
this.stackable = stackable; | ||
|
||
this.minimumArea = getMinimumArea(stackValues); | ||
this.maximumArea = getMinimumArea(stackValues); | ||
} | ||
|
||
public Stackable getStackable() { | ||
return stackable; | ||
} | ||
|
||
public StackValue getStackValue(int index) { | ||
return values[index]; | ||
} | ||
|
||
@Override | ||
public long getVolume() { | ||
return stackable.getVolume(); | ||
} | ||
|
||
@Override | ||
public int getWeight() { | ||
return stackable.getWeight(); | ||
} | ||
|
||
@Override | ||
public StackValue[] getStackValues() { | ||
return values; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return stackable.getDescription(); | ||
} | ||
|
||
@Override | ||
public String getId() { | ||
return stackable.getId(); | ||
} | ||
|
||
@Override | ||
public Stackable clone() { | ||
return new BoundedStackable(stackable.clone(), values); | ||
} | ||
|
||
@Override | ||
public long getMinimumArea() { | ||
return minimumArea; | ||
} | ||
|
||
@Override | ||
public long getMaximumArea() { | ||
return maximumArea; | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
api/src/main/java/com/github/skjolber/packing/api/packager/DefaultLoadableItemFilter.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
api/src/main/java/com/github/skjolber/packing/api/packager/DefaultStackableItemsFilter.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,16 @@ | ||
package com.github.skjolber.packing.api.packager; | ||
|
||
public class DefaultStackableItemsFilter implements StackableItemsFilter { | ||
|
||
protected final StackableItems loadableItems; | ||
|
||
public DefaultStackableItemsFilter(StackableItems loadableItems) { | ||
this.loadableItems = loadableItems; | ||
} | ||
|
||
@Override | ||
public void loaded(int index) { | ||
// do nothing | ||
} | ||
|
||
} |
64 changes: 0 additions & 64 deletions
64
api/src/main/java/com/github/skjolber/packing/api/packager/Loadable.java
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
api/src/main/java/com/github/skjolber/packing/api/packager/LoadableItem.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.