Esempio n. 1
0
 /**
  * Sets the underlying array of the heap and set the size to be the length of given array.
  *
  * <p><i>Caution</i>: If the heap was heapified before this method call, it may become no longer
  * heapified.
  *
  * @param array the array to set
  * @return this object itself for fluent calls
  */
 public IntHeap setArray(int[] array) {
   this.array = Utils.argumentNotNull(array, "array");
   size = array.length;
   return this;
 }
Esempio n. 2
0
 /**
  * Construct a zero size heap with given array as storage.
  *
  * @param array the array to be used as underlying heap storage
  */
 public IntHeap(final int[] array) {
   this.array = Utils.argumentNotNull(array, "array");
 }