org.opengts.util
Class TabulatedMap<KEYTYPE,VALTYPE>

java.lang.Object
  extended by org.opengts.util.TabulatedMap<KEYTYPE,VALTYPE>

public class TabulatedMap<KEYTYPE,VALTYPE>
extends java.lang.Object


Constructor Summary
TabulatedMap()
          Constructor
 
Method Summary
 void add(KEYTYPE key, VALTYPE val)
          Counts the occurrance of the specified key
 long getCount(KEYTYPE key)
          Returns the count for the specified key
 java.util.Iterator<KEYTYPE> getIterator()
          Returns an Iterator.
 java.util.Iterator<KEYTYPE> getIterator(java.util.Comparator<KEYTYPE> sortBy)
          Returns an Iterator.
 java.util.List<KEYTYPE> getKeyList()
          Return a list of keys
 java.util.List<KEYTYPE> getKeyList(java.util.Comparator<KEYTYPE> sortBy)
          Return a sorted list of keys
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabulatedMap

public TabulatedMap()
Constructor

Method Detail

getIterator

public java.util.Iterator<KEYTYPE> getIterator()
Returns an Iterator. Items are in random order


getIterator

public java.util.Iterator<KEYTYPE> getIterator(java.util.Comparator<KEYTYPE> sortBy)
Returns an Iterator. Items are sorted by specified comparator.

Parameters:
sortBy - The Comparator by which the returned iterator is sorted
Returns:
The Iterator

getKeyList

public java.util.List<KEYTYPE> getKeyList()
Return a list of keys

Returns:
A list of keys

getKeyList

public java.util.List<KEYTYPE> getKeyList(java.util.Comparator<KEYTYPE> sortBy)
Return a sorted list of keys

Returns:
A sorted list of keys

add

public void add(KEYTYPE key,
                VALTYPE val)
Counts the occurrance of the specified key

Parameters:
key - The key which will be counted

getCount

public long getCount(KEYTYPE key)
Returns the count for the specified key

Parameters:
key - The key for which the count is returned
Returns:
The count