I have this object:
Public Cactus{
Public Double key;
Public String value;
}
I have about ~100 Cactus, which all have
Yes, using a double value as a key seems awkward. Are those double values results of some computations that may have some very tiny round-off errors? If you are going to compute those values and access the collection with those computed values, it is highly likely that there is going to be unwanted results.
For example, you store an element with key value 1.01. Your computations would result 1.010000000000000123, and will not match the stored key.
If this is not the case, then I see no problem using a double value as the key of a dictionary, or hashtable collection.
BTW, using a typed Dictionary (i.e., Dictionary) will be easier to use than a HashTable.