1 package it.unimi.dsi.fastutil; 2 3 /* 4 * fastutil: Fast & compact type-specific collections for Java 5 * 6 * Copyright (C) 2003, 2004, 2005, 2006 Paolo Boldi and Sebastiano Vigna 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2.1 of the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 * 22 */ 23 24 import java.util.Comparator; 25 26 /** An indirect double priority queue. 27 * 28 * <P>An indirect double priority queue uses two distinct comparators (called <em>primary</em> 29 * and <em>secondary</em>) to keep its elements ordered. It makes it possible to access the 30 * first element w.r.t. the secondary comparatory using {@link #secondaryFirst()} (and, optionally, 31 * the last element using {@link #secondaryLast()}). The remaining methods 32 * work like those of an {@linkplain it.unimi.dsi.fastutil.IndirectPriorityQueue indirect priority queue} based on the 33 * primary comparator. 34 */ 35 36 public interface IndirectDoublePriorityQueue<K> extends IndirectPriorityQueue<K> { 37 38 /** Returns the first element of this queue with respect to the {@linkplain #secondaryComparator() secondary comparator}. 39 * 40 * @return the first element of this queue w.r.t. the {@linkplain #secondaryComparator() secondary comparator}. 41 */ 42 public int secondaryFirst(); 43 44 /** Returns the last element of this queue with respect to the {@linkplain #secondaryComparator() secondary comparator} (optional operation). 45 * 46 * @return the last element of this queue w.r.t. the {@linkplain #secondaryComparator() secondary comparator}. 47 */ 48 public int secondaryLast(); 49 50 /** Returns the secondary comparator of this queue. 51 * 52 * @return the secondary comparator of this queue. 53 * @see #secondaryFirst() 54 */ 55 public Comparator<? super K> secondaryComparator(); 56 } 57