- add
Adds the specified element to the end of this bag. If required, it also
increases the capacity of th
- size
Returns the number of elements in this bag.
- <init>
Constructs an empty Bag with the specified initial capacity.
- get
Returns the element at the specified position in Bag.
- getData
Returns this bag's underlying array. Use with care.
- remove
Removes the element at the specified position in this Bag. It does this by
overwriting it was last e
- set
Set element at specified index in the bag.
- setSize
Set the size. This will not resize the bag, nor will it clean up contents beyond
the given size. Use
- clear
Removes all of the elements from this bag. The bag will be empty after this call
returns.
- ensureCapacity
Check if an item, if added at the given item will fit into the bag. If not, the
bag capacity will be
- contains
Check if bag contains this element.
- getCapacity
Returns the number of elements the bag can hold without growing.