de.jstacs.utils
Class ToolBox

java.lang.Object
  extended by de.jstacs.utils.ToolBox

public class ToolBox
extends Object

This class is a collection of methods which might be useful for the programmer.

Author:
Jens Keilwagen

Constructor Summary
ToolBox()
           
 
Method Summary
static
<K> Hashtable<K,Integer>
parseHashSet2IndexHashtable(HashSet<K> set)
          This method converts a HashSet in a Hashtable with unique indices starting at 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolBox

public ToolBox()
Method Detail

parseHashSet2IndexHashtable

public static <K> Hashtable<K,Integer> parseHashSet2IndexHashtable(HashSet<K> set)
This method converts a HashSet in a Hashtable with unique indices starting at 0. The indices are derived from the order of the Iterator of the HashSet.

Type Parameters:
K - the type of the keys
Parameters:
set - the set of keys
Returns:
a Hashtable with keys and unique indices starting at 0