public final class Bin extends Object
This class is used by the BinPackingSolution class to represent the contents of a bin in a solution to a BinPacking problem 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.
  • Method Details

    • space

      public final int space()
      Gets the amount of space remaining in the bin.
      the amount of remaining space
    • size

      public final int size()
      Gets the number of items in the Bin.
      the number of items in the Bin
    • getItem

      public 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()