/*
PseudoCode Interpreted Language (PCIL): Part of the algoviz@vt collection of algorithm visualizations.
Copyright (C) 2008 Brandon Malone, Frank Hadlock
This file is part of the PseudoCode Interpreted Language.
PseudoCode Interpreted Language is free software: you can redistribute
it and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
PseudoCode Interpreted Language is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with
PseudoCode Interpreted Language. If not, see
.
*/
/*
* PrimitivePriorityQueueElementComparator.java
*
* Created on March 15, 2008, 12:21 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package dynamicmvc;
/**
*
* @author Brandon
*/
public class PrimitivePriorityQueueElementComparator implements java.util.Comparator {
public static PrimitivePriorityQueueElementComparator instance;
public static PrimitivePriorityQueueElementComparator getInstance() {
if (instance == null) {
instance = new PrimitivePriorityQueueElementComparator();
}
return instance;
}
/** Creates a new instance of PrimitivePriorityQueueElementComparator */
public PrimitivePriorityQueueElementComparator() {
}
public int compare(PrimitivePointer o1, PrimitivePointer o2) {
PrimitivePriorityQueueElement e1 = (PrimitivePriorityQueueElement)o1.dereference();
PrimitivePriorityQueueElement e2 = (PrimitivePriorityQueueElement)o2.dereference();
return e1.compareTo(e2);
}
}