org.gcube.indexmanagement.featureindexlibrary.commons
Class SortedHeap

java.lang.Object
  extended by org.gcube.indexmanagement.featureindexlibrary.commons.SortedHeap

public class SortedHeap
extends Object

A Sorted heal utility

Author:
UoA

Constructor Summary
SortedHeap()
          Creates a new instance
 
Method Summary
 void add(HeapElement element)
          Adds the element
 HeapElement get(int i)
          Retrieves the elment in the given position
 int getNumberOfElements()
          Retrieves the number of results
 void sort()
          Sorts the existing elements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedHeap

public SortedHeap()
Creates a new instance

Method Detail

getNumberOfElements

public int getNumberOfElements()
Retrieves the number of results

Returns:
The number of results

get

public HeapElement get(int i)
Retrieves the elment in the given position

Parameters:
i - The index of the elmnt to retrieve
Returns:
The element

add

public void add(HeapElement element)
Adds the element

Parameters:
element - The elment

sort

public void sort()
Sorts the existing elements



Copyright © 2013. All Rights Reserved.