Package edu.claflin.finder.algo.clustering.struct.girvan_newman_struct

# Class MapBinaryHeap<T>

java.lang.Object
java.util.AbstractCollection<T>
edu.claflin.finder.algo.clustering.struct.girvan_newman_struct.MapBinaryHeap<T>

All Implemented Interfaces:
  `Iterable<T>`, `Collection<T>`, `Queue<T>`

public class MapBinaryHeap<T> extends AbstractCollection<T> implements Queue<T>

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `private class`
  `MapBinaryHeap.ComparableComparator`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `private Comparator<T>`
  `comp`
  `private Vector<T>`
  `heap`
  `private Map<T,Integer>`
  `object_indices`
  `private static final int`
  `TOP`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MapBinaryHeap()`
  `MapBinaryHeap(Collection<T> c)`
  `MapBinaryHeap(Collection<T> c, Comparator<T> comp)`
  `MapBinaryHeap(Comparator<T> comp)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `add(T o)`
  `void`
  `clear()`
  `boolean`
  `contains(Object o)`
  `T`
  `element()`
  `private void`
  `initialize(Comparator<T> comp)`
  `boolean`
  `isEmpty()`
  `Iterator<T>`
  `iterator()`
  `private int`
  `lChild(int i)`
  `boolean`
  `offer(T o)`
  `private int`
  `parent(int i)`
  `T`
  `peek()`
  `private void`
  `percolateDown(int cur)`
  `private int`
  `percolateUp(int cur, T o)`
  `T`
  `poll()`
  `private int`
  `rChild(int i)`
  `T`
  `remove()`
  `boolean`
  `remove(Object o)`
  `boolean`
  `removeAll(Collection<?> c)`
  `boolean`
  `retainAll(Collection<?> c)`
  `int`
  `size()`
  `private void`
  `swap(int i, int j)`
  `void`
  `update(T o)`

  ### Methods inherited from class java.util.AbstractCollection

  `addAll, containsAll, toArray, toArray, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.util.Collection

  `addAll, containsAll, equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray, toArray, toArray`

  ### Methods inherited from interface java.lang.Iterable

  `forEach`

- ## Field Details

  - ### heap

    private Vector<T> heap

  - ### object_indices

    private Map<T,Integer> object_indices

  - ### comp

    private Comparator<T> comp

  - ### TOP

    private static final int TOP
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### MapBinaryHeap

    public MapBinaryHeap(Comparator<T> comp)

  - ### MapBinaryHeap

    public MapBinaryHeap()

  - ### MapBinaryHeap

    public MapBinaryHeap(Collection<T> c)

  - ### MapBinaryHeap

    public MapBinaryHeap(Collection<T> c, Comparator<T> comp)

- ## Method Details

  - ### initialize

    private void initialize(Comparator<T> comp)

  - ### clear

    public void clear()
    Specified by:
      `clear` in interface `Collection<T>`
    Overrides:
      `clear` in class `AbstractCollection<T>`

  - ### add

    public boolean add(T o)
    Specified by:
      `add` in interface `Collection<T>`
    Specified by:
      `add` in interface `Queue<T>`
    Overrides:
      `add` in class `AbstractCollection<T>`

  - ### isEmpty

    public boolean isEmpty()
    Specified by:
      `isEmpty` in interface `Collection<T>`
    Overrides:
      `isEmpty` in class `AbstractCollection<T>`

  - ### peek

    public T peek()
    Specified by:
      `peek` in interface `Queue<T>`

  - ### size

    public int size()
    Specified by:
      `size` in interface `Collection<T>`
    Specified by:
      `size` in class `AbstractCollection<T>`

  - ### update

    public void update(T o)

  - ### contains

    public boolean contains(Object o)
    Specified by:
      `contains` in interface `Collection<T>`
    Overrides:
      `contains` in class `AbstractCollection<T>`

  - ### percolateDown

    private void percolateDown(int cur)

  - ### percolateUp

    private int percolateUp(int cur, T o)

  - ### lChild

    private int lChild(int i)

  - ### rChild

    private int rChild(int i)

  - ### parent

    private int parent(int i)

  - ### swap

    private void swap(int i, int j)

  - ### iterator

    public Iterator<T> iterator()
    Specified by:
      `iterator` in interface `Collection<T>`
    Specified by:
      `iterator` in interface `Iterable<T>`
    Specified by:
      `iterator` in class `AbstractCollection<T>`

  - ### remove

    public boolean remove(Object o)
    Specified by:
      `remove` in interface `Collection<T>`
    Overrides:
      `remove` in class `AbstractCollection<T>`

  - ### removeAll

    public boolean removeAll(Collection<?> c)
    Specified by:
      `removeAll` in interface `Collection<T>`
    Overrides:
      `removeAll` in class `AbstractCollection<T>`

  - ### retainAll

    public boolean retainAll(Collection<?> c)
    Specified by:
      `retainAll` in interface `Collection<T>`
    Overrides:
      `retainAll` in class `AbstractCollection<T>`

  - ### element

    public T element() throws NoSuchElementException
    Specified by:
      `element` in interface `Queue<T>`
    Throws:
      `NoSuchElementException`

  - ### offer

    public boolean offer(T o)
    Specified by:
      `offer` in interface `Queue<T>`

  - ### poll

    public T poll()
    Specified by:
      `poll` in interface `Queue<T>`

  - ### remove

    public T remove()
    Specified by:
      `remove` in interface `Queue<T>`