001/* Copyright (C) 2013 TU Dortmund 002 * This file is part of AutomataLib, http://www.automatalib.net/. 003 * 004 * AutomataLib is free software; you can redistribute it and/or 005 * modify it under the terms of the GNU Lesser General Public 006 * License version 3.0 as published by the Free Software Foundation. 007 * 008 * AutomataLib is distributed in the hope that it will be useful, 009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 011 * Lesser General Public License for more details. 012 * 013 * You should have received a copy of the GNU Lesser General Public 014 * License along with AutomataLib; if not, see 015 * http://www.gnu.de/documents/lgpl.en.html. 016 */ 017package net.automatalib.commons.smartcollections; 018 019import java.util.Comparator; 020import java.util.PriorityQueue; 021 022/** 023 * A priority queue interface. 024 * 025 * A priority queue is a queue which supports removal of the element with 026 * the minimal key value (wrt. natural ordering or an explicitly specified 027 * {@link Comparator}). 028 * 029 * This interface extends the functionality of the standard 030 * {@link PriorityQueue} in the way that it allows dynamic behavior: The 031 * ordering of the elements in the queue is allowed to change. The only 032 * restriction is that whenever the key which is used for comparison changes, 033 * the method {@link #keyChanged(ElementReference)} has to be called with 034 * the reference of the respective element. 035 * 036 * 037 * @author Malte Isberner 038 * 039 * @param <E> element class. 040 */ 041public interface SmartDynamicPriorityQueue<E> 042 extends SmartPriorityQueue<E> { 043 044 /** 045 * Notifies the implementation that the key of an element has changed. 046 * 047 * @param reference the reference for the element whose key has changed. 048 */ 049 public void keyChanged(ElementReference reference); 050}