public final class Bin extends Object
This class is used by the
BinPackingSolutionclass to represent the contents of a bin in a solution to a
BinPackingproblem instance. Although you cannot construct instances of it directly (it doesn't have a public constructor), you can use the methods of this class to inspect the contents (i.e., which items) of the Bin.
spacepublic final int space()Gets the amount of space remaining in the bin.
- the amount of remaining space
sizepublic final int size()Gets the number of items in the Bin.
- the number of items in the Bin
getItempublic final int getItem
(int i)Gets the id of an item in this bin.
i- an index into the bin
- the id of the item at index i.
IndexOutOfBoundsException- if i is negative or greater than or equal to size()