com.github.skjolberg.packing.BoxItem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of 3d-bin-container-packing Show documentation
Show all versions of 3d-bin-container-packing Show documentation
Library for 3D rectangular bin packing
package com.github.skjolberg.packing;
import java.io.Serializable;
/**
* A {@linkplain Box} repeated one or more times. Typically corresponding to an order-line, but
* can also represent multiple products which share the same size.
*
*/
public class BoxItem implements Serializable {
private final int count;
private final Box box;
public BoxItem(Box box) {
this(box, 1);
}
public BoxItem(Box box, int count) {
super();
this.box = box;
this.count = count;
}
public int getCount() {
return count;
}
public Box getBox() {
return box;
}
@Override
public String toString() {
return String.format("%dx%s", count, box);
}
}