IT Hardwares

eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
Business & Money
Technology
Women
Health
Education
Family
Travel
Cars
Entertainment
SD Editorials
Online Guide and article directory site.
Foodeditorials.com
Over 15,000 recipes & editorials on food.
Lyricadvisor.com
Get 100,000 Lyric & Albums.
  • Business & Money
    • A Guide to Business
    • Guide to Finance
    • Ideas for Marketing
    • Legal Guide
    • Guide to Insurance
    • Lettre De Motivation
    • Guide to the Stock Market
    • Human Resource Career
    • Sales Marketing
    • Forex & Trading
    • Advertising & Marketing
    • Startup Guide
  • Technology
    • Guide to Technology
    • Cell Phones
    • Computer Software
    • IT Hardwares
    • Internet
    • Online Security
    • Cameras
    • Search Engine Optimization
    • Science & Technology
  • Women
    • Guide to Women
    • Relationship Advice
    • Marriage
    • Jewelry
    • Pregnancy
    • Fashion Style
    • Divorce Guide
    • Wedding Guide
    • Dating Guide
    • Natural Beauty
  • Health
    • Guide to Health
    • Guide to Medical
    • Plastic Surgery
    • Weight Loss
    • Sports
    • Body Wellness
    • Cancer Treatment
    • Common Illness
    • Health & Lifestyle
  • Education
    • Military Service
    • Politics and Policy
    • Arts & Humanities
    • Education and Teaching
    • Learn Languages
    • Colleges & Universities
  • Family
    • Quality Home Improvement
    • Hobbies and Interests
    • Family Guide to
    • Pet Guide
    • Loans Guide
    • Credit Cards
    • Gardening Guide
    • Home Security
    • Real Estate
    • Home Decor
    • Gift & Present
  • Travel
    • The Travel Guide
    • Adventure Travel
    • Cruise Ships
    • Beach Holiday
    • Travel Accommodation
    • Holiday Destinations
  • Cars
    • Information on Cars
    • Traffic Violations
    • Auto Insurance
    • Trailers
    • Sport Cars
    • The Bikes
  • Entertainment
    • Entertainment Guide
    • World Music
    • Photo & Video
    • Television & Games

Hashtable

    View: 
Map interface does not implement Collection interface, because it does not contain elements but contains entries of keys and their corresponding values (i.e. called mapping).



Map does not allow duplicate keys. So there is utmost one value that is mapped with the given key.

Both key and value must be an Object (Primitive values must be wrapped).

Hashtable implements Map interface (As of the Java 2 platform v1.2, this class has been retrofitted to implement Map, so that it becomes a part of Java's collection framework).

Hashtables will automatically grow when you add too many elements. However, growing requires copying, rehashing and rechaining, which affects its overall performance.

Performance of Hashtable depends on two important factors that are

• Initial Capacity and

• Load Factor

Initial Capacity is the capacity at the time the hash table is created. Load factor determines when to increase the capacity of the Hashtable. The default load factor is 0.75.

Important Note: The initial capacity is not the actual number of elements you plan to store in hashtable. Say for example, if you set initial capacity of 100 and the load factor is 0.75, then the capacity of Hashtable will be automatically increased when it reaches to 75 not 100.

Constructors

Hashtable ()

Constructs empty hashtable with a default initial capacity 11 and load factor 0.75.

Hashtable (int initialCapacity)

Constructs empty hashtable with the specified initial capacity and default load factor 0.75.

Hashtable (int initialCapacity, float loadFactor)

Constructs empty hashtable with the specified initial capacity and the specified load factor.

Hashtable (Map t)

Constructs a new hashtable with the mappings same as the passed Map.

Basic methods

Object get (Object key)

Returns the value mapped to the specified key, or null if no entry is found.

Object put (Object key, Object value)

Maps the specified key to the specified value in this hashtable and returns the value previously associated with the specified key, if any. Otherwise, it returns the null value.

Object remove (Object key)

Removes the key and its associated value from the hashtable, and returns the value previously associated with the specified key, if any. Otherwise, it returns the null value.

boolean containsKey(Object key)

Returns true if the specified key is mapped to some value in the map, otherwise false.

boolean containsValue(Object value)

Returns true if there are one or more keys mapped to the specified value, otherwise false.

int size()

Returns the size of the hashtable.

boolean isEmpty()

returns true if hashtable is empty, otherwise false.

Other methods

void putAll(Map t)

copies all mappings from the map to current hashtable and replaces existing entries, if any.

Void clear()

Removes all mappings from hashtable.

Collection values()

Returns collection of the values contained in the hashtable.

Enumeration elements()

Return Enumeration of the values contained in the hashtable.

Set entrySet()

Returns a Set of entries contained in the Hashtable.

Enumeration keys()

Return Enumeration of keys contained in the hashtable.

Object clone()

Creates copy of the hashtable.

Note : hashtable may throw IllegalArgumentException, if any unsupported operation is invoked.
More Articles from
Computer Hardware Guide Pg501
Administrator Duties And Responsibilities
Certification Exam Pharmacy Technician
How Do Wireless Routers Work
How To Use Virtual
List Of Port Numbers
Mobile Market Share 2008
Network Attached Storage For Home
Network Monitoring Tools For
Network Security Risk Assessment
Network Support Technician Jobs
One Two Three Words
Recover Data From External Hard Drive
Reverse Address Resolution Protocol
Router With Network Storage
Types Of Fiber Cables
What Is Bus Topology
World Wide Publishing Service
Network Timing: NTP Time Servers
Need to know about online business
Netbook And Its Diverse Efficacy
» More on
Computer Hardware Guide
  • Related Articles
  • Author
  • Most Popular
Rahim Vindhani has sinced written about articles on various topics from Computers and The Internet. . Rahim Vindhani's top article generates over 5400 views. to your Favourites.
Checking Account Overdraft Protection
10 dollars in much better than 30, dont you think? So if you are tired of acquiring overdraft charges and you have tried tracking your purchases, it may be a good idea to contact your institution ...
 
A Guide to Business | Guide to Technology | Guide to Women | Guide to Health | Family Guide to | Travel & Vacations | Information on Cars

EditorialToday IT Hardwares has 2 sub sections. Such as Computer Guide and Hardware. With over 20,000 authors and writers, we are a well known online resource and editorial services site in United Kingdom, Canada & America . Here, we cover all the major topics from self help guide to A Guide to Business, Guide to Finance, Ideas for Marketing, Legal Guide, Lettre De Motivation, Guide to Insurance, Guide to Health, Guide to Medical, Military Service, Guide to Women, Pet Guide, Politics and Policy , Guide to Technology, The Travel Guide, Information on Cars, Entertainment Guide, Family Guide to, Hobbies and Interests, Quality Home Improvement, Arts & Humanities and many more.
About Editorial Today | Contact Us | Terms of Use | Submit an Article | Our Authors