All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cc.mallet.util.search.PriorityQueue Maven / Gradle / Ivy

Go to download

MALLET is a Java-based package for statistical natural language processing, document classification, clustering, topic modeling, information extraction, and other machine learning applications to text.

The newest version!
package cc.mallet.util.search;

/**
 * Created by IntelliJ IDEA.
 * User: pereira
 * Date: Jun 18, 2005
 * Time: 7:46:46 PM
 *
 * Interface representing the basic methods for a priority queue.
 */
public interface PriorityQueue {
  /**
   * Insert element e into the queue.
   * @param e the element to insert
   */
  public void insert(QueueElement e);

  /**
   * The current size of the queue.
   * @return current size
   */
  public int size();

  /**
   * Return the top element of the queue.
   * @return top element of the queue
   */
  public QueueElement min();

  /**
   * Remove the top element of the queue.
   * @return the element removed
   */
  public QueueElement extractMin();

  /**
   * Change the priority of queue element e to priority.
   * The element's position in the queue is adjusted as needed.
   * @param e the element that has been changed
   * @param priority the new priority
   */
  public void changePriority (QueueElement e, double priority);

  /**
   * Does the queue contain an element?
   * @param e the element
   * @return whether the queue contains the element
   */
  public boolean contains(QueueElement e);

  /** Returns any array containing all of the elements in the queue.
   *   They are not guaranteed to be in any particular order.
   */
  public QueueElement[] toArray ();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy