Terrenus HRPT v2.2

terrenus.util
Class FrequencyMap<E>

java.lang.Object
  extended by terrenus.util.FrequencyMap<E>

public class FrequencyMap<E>
extends java.lang.Object

The FrequencyMap class is used to store a number of values (possible more than one occurrance of a value) and retrieve the most frequently occurring value.


Constructor Summary
FrequencyMap()
           
 
Method Summary
 E getFreqValue()
          Gets the current most frequently occurring value.
 void put(E value)
          Puts another occurrance of the value into the frequency map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrequencyMap

public FrequencyMap()
Method Detail

put

public void put(E value)
Puts another occurrance of the value into the frequency map.

Parameters:
value - the value to add.

getFreqValue

public E getFreqValue()
Gets the current most frequently occurring value.

Returns:
the most frequently occurring value or null if none exists because the map is empty.

Terrenus HRPT v2.2