Results 1 to 4 of 4
Thread: isWellFormed() for HashMap
- 04-21-2011, 07:58 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 4
- Rep Power
- 0
isWellFormed() for HashMap
Hello, I`m doing a project where I have to store the accounts of a bank in a hash table structure. I have managed to do that by using a HashMap object and storing the accounts using the pin numbers as keys.
The project demands that I use design by contract and I need to create a isWellFormed() method for the hash map in order to check the hash function it uses, whether the linked list is created properly... and I don't know how I could access the elements of the HashMap. Any ideas?
- 04-22-2011, 12:39 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 339
- Rep Power
- 5
The HashMap API docs tell you all the access methods available.
- 04-22-2011, 08:02 AM #3
Member
- Join Date
- Apr 2011
- Posts
- 4
- Rep Power
- 0
I have read the API docs and have worked with the HashMap. The rest of the project is done, I just need to make a method which checks if the HashMap is correctly built. I know its kinda weird since it is a java class, but that`s what the project requires.
I need access to the hash function and to the linked list it creates in case of collision...
- 04-22-2011, 03:01 PM #4
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
I'm just guessing here as you don't provide much information on the requirements, but it sounds like the project requires you to write your own HashMap/HashTable - these values (hash function and buckets) are encapsulated within the HashMap class (eg, they aren't visible and you can't access these directly), and I can guarantee they are correctly built
Last edited by doWhile; 04-22-2011 at 03:03 PM.
Similar Threads
-
Hashmap to TXT and TXT to Hashmap
By elvinny in forum Advanced JavaReplies: 4Last Post: 02-16-2011, 11:12 PM -
How to create a new HashMap from a HashMap entries of other methods
By pandeyalok in forum Advanced JavaReplies: 7Last Post: 12-08-2009, 07:17 PM -
HashMap
By koolhoney in forum Advanced JavaReplies: 1Last Post: 03-30-2009, 08:08 PM -
Hashmap - get key according to value
By gtriant in forum New To JavaReplies: 1Last Post: 12-15-2008, 02:29 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks