code: public final void put(long priority, Object value)
    {
  //    if (tc.isEntryEnabled())
  //      SibTr.entry(tc, "put", new Object[] { new Long(priority), value});
  
      PriorityQueueNode node = new PriorityQueueNode(priority,value);
  
      // Resize the array (double it) if we are out of space.
      if (size == elements.length)
      {
        PriorityQueueNode[] tmp = new PriorityQueueNode[2*size];
        System.arraycopy(elements,0,tmp,0,size);
        elements = tmp;
      }
  
      int pos = size++;
      setElement(node, pos);
  
      moveUp(pos);
  
  //    if (tc.isEntryEnabled())
  //      SibTr.exit(tc, "put");
    }
docs: Insert data with the given priority into the heap and heapify.
  
  @param priority the priority to associate with the new data.
  @param value the date to enqueue.