cz.cuni.amis.utils.astar
Class AStarHeap<NODE>

java.lang.Object
  extended by cz.cuni.amis.utils.astar.AStarHeap<NODE>
All Implemented Interfaces:
java.lang.Iterable<NODE>, java.util.Collection<NODE>

public class AStarHeap<NODE>
extends java.lang.Object
implements java.util.Collection<NODE>

This is Heap used by AStar algorithm. Note that we assume that inserted Object has correctly implemented hashCode() and equals() function!


Constructor Summary
AStarHeap(java.util.Comparator<NODE> comp)
           
AStarHeap(java.util.Comparator<NODE> comp, int capacity)
           
 
Method Summary
 boolean add(NODE arg0)
           
 boolean addAll(java.util.Collection arg0)
           
 boolean addAll(NODE[] arg0)
           
 void clear()
           
 boolean contains(java.lang.Object arg0)
           
 boolean containsAll(java.util.Collection arg0)
           
 boolean containsAll(java.lang.Object[] arg0)
           
 boolean decreaseKey(NODE arg0)
           
 boolean deleteMin()
           
 boolean empty()
           
 NODE getMin()
           
 boolean isEmpty()
           
 java.util.Iterator<NODE> iterator()
           
static void main(java.lang.String[] args)
           
static void mainAdd(AStarHeap heap, java.lang.Integer[] nums)
           
static boolean mainCheck(AStarHeap heap, java.lang.Integer[] nums)
           
static java.lang.String mainToStr(java.lang.Integer[] nums)
           
 boolean remove(java.lang.Object arg0)
           
 boolean removeAll(java.util.Collection arg0)
           
 boolean retainAll(java.util.Collection arg0)
           
 int size()
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] arg0)
           
 java.util.Set toSet()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

AStarHeap

public AStarHeap(java.util.Comparator<NODE> comp,
                 int capacity)

AStarHeap

public AStarHeap(java.util.Comparator<NODE> comp)
Method Detail

getMin

public NODE getMin()

deleteMin

public boolean deleteMin()

decreaseKey

public boolean decreaseKey(NODE arg0)

add

public boolean add(NODE arg0)
Specified by:
add in interface java.util.Collection<NODE>

addAll

public boolean addAll(java.util.Collection arg0)
Specified by:
addAll in interface java.util.Collection<NODE>

addAll

public boolean addAll(NODE[] arg0)

clear

public void clear()
Specified by:
clear in interface java.util.Collection<NODE>

contains

public boolean contains(java.lang.Object arg0)
Specified by:
contains in interface java.util.Collection<NODE>

containsAll

public boolean containsAll(java.util.Collection arg0)
Specified by:
containsAll in interface java.util.Collection<NODE>

containsAll

public boolean containsAll(java.lang.Object[] arg0)

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<NODE>

iterator

public java.util.Iterator<NODE> iterator()
Specified by:
iterator in interface java.lang.Iterable<NODE>
Specified by:
iterator in interface java.util.Collection<NODE>

remove

public boolean remove(java.lang.Object arg0)
Specified by:
remove in interface java.util.Collection<NODE>

removeAll

public boolean removeAll(java.util.Collection arg0)
Specified by:
removeAll in interface java.util.Collection<NODE>

retainAll

public boolean retainAll(java.util.Collection arg0)
Specified by:
retainAll in interface java.util.Collection<NODE>

size

public int size()
Specified by:
size in interface java.util.Collection<NODE>

empty

public boolean empty()

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<NODE>

toArray

public java.lang.Object[] toArray(java.lang.Object[] arg0)
Specified by:
toArray in interface java.util.Collection<NODE>

toSet

public java.util.Set toSet()

mainToStr

public static java.lang.String mainToStr(java.lang.Integer[] nums)

mainCheck

public static boolean mainCheck(AStarHeap heap,
                                java.lang.Integer[] nums)

mainAdd

public static void mainAdd(AStarHeap heap,
                           java.lang.Integer[] nums)

main

public static void main(java.lang.String[] args)