How can you retrieve the Hashtable's load factor?

John Zukowski

There is no public interface to access the load factor setting.

Some choices you can do to expose this value...

  • Subclass Hashtable and add a read-only accessor method
  • Use reflection to access the private field (only possible in trusted environment)
  • Serialize the Hashtable and get the value from the stream (when reading back the stream, you'll have to figure out where the appropriate field is)
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact