cz.cuni.amis.utils.astar
Class AStarHeap<NODE>
java.lang.Object
cz.cuni.amis.utils.astar.AStarHeap<NODE>
- All Implemented Interfaces:
- Iterable<NODE>, Collection<NODE>
public class AStarHeap<NODE>
- extends Object
- implements Collection<NODE>
This is Heap used by AStar algorithm.
Note that we assume that inserted Object has correctly implemented hashCode()
and equals() function!
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AStarHeap
public AStarHeap(Comparator<NODE> comp,
int capacity)
AStarHeap
public AStarHeap(Comparator<NODE> comp)
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 Collection<NODE>
addAll
public boolean addAll(Collection arg0)
- Specified by:
addAll
in interface Collection<NODE>
addAll
public boolean addAll(NODE[] arg0)
clear
public void clear()
- Specified by:
clear
in interface Collection<NODE>
contains
public boolean contains(Object arg0)
- Specified by:
contains
in interface Collection<NODE>
containsAll
public boolean containsAll(Collection arg0)
- Specified by:
containsAll
in interface Collection<NODE>
containsAll
public boolean containsAll(Object[] arg0)
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Collection<NODE>
iterator
public Iterator<NODE> iterator()
- Specified by:
iterator
in interface Iterable<NODE>
- Specified by:
iterator
in interface Collection<NODE>
remove
public boolean remove(Object arg0)
- Specified by:
remove
in interface Collection<NODE>
removeAll
public boolean removeAll(Collection arg0)
- Specified by:
removeAll
in interface Collection<NODE>
retainAll
public boolean retainAll(Collection arg0)
- Specified by:
retainAll
in interface Collection<NODE>
size
public int size()
- Specified by:
size
in interface Collection<NODE>
empty
public boolean empty()
toArray
public Object[] toArray()
- Specified by:
toArray
in interface Collection<NODE>
toArray
public Object[] toArray(Object[] arg0)
- Specified by:
toArray
in interface Collection<NODE>
toSet
public Set toSet()
mainToStr
public static String mainToStr(Integer[] nums)
mainCheck
public static boolean mainCheck(AStarHeap heap,
Integer[] nums)
mainAdd
public static void mainAdd(AStarHeap heap,
Integer[] nums)
main
public static void main(String[] args)
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.