Java Doc for Hashtable.java in  » Apache-Harmony-Java-SE » java-package » java » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.Hashtable

Hashtable
public class Hashtable extends Dictionary implements Map<K, V>,Cloneable,Serializable(Code)
Hashtable associates keys with values. Keys and values cannot be null. The size of the Hashtable is the number of key/value pairs it contains. The capacity is the number of key/value pairs the Hashtable can hold. The load factor is a float value which determines how full the Hashtable gets before expanding the capacity. If the load factor of the Hashtable is exceeded, the capacity is doubled.
See Also:   Enumeration
See Also:   java.io.Serializable
See Also:   java.lang.Object.equals
See Also:   java.lang.Object.hashCode


Field Summary
transient  intelementCount
    
transient  Entry<K, V>[]elementData
    
transient  intfirstSlot
    
transient  intlastSlot
    
transient  intmodCount
    

Constructor Summary
public  Hashtable()
     Constructs a new Hashtable using the default capacity and load factor.
public  Hashtable(int capacity)
     Constructs a new Hashtable using the specified capacity and the default load factor.
public  Hashtable(int capacity, float loadFactor)
     Constructs a new Hashtable using the specified capacity and load factor.
public  Hashtable(Map<? extends K, ? extends V> map)
     Constructs a new instance of Hashtable containing the mappings from the specified Map.

Method Summary
public synchronized  voidclear()
     Removes all key/value pairs from this Hashtable, leaving the size zero and the capacity unchanged.
public synchronized  Objectclone()
     Answers a new Hashtable with the same key/value pairs, capacity and load factor.
public synchronized  booleancontains(Object value)
     Answers if this Hashtable contains the specified object as the value of at least one of the key/value pairs.
public synchronized  booleancontainsKey(Object key)
     Answers if this Hashtable contains the specified object as a key of one of the key/value pairs.
public  booleancontainsValue(Object value)
     Searches this Hashtable for the specified value.
public synchronized  Enumeration<V>elements()
     Answers an Enumeration on the values of this Hashtable.
public  Set<Map.Entry<K, V>>entrySet()
     Answers a Set of the mappings contained in this Hashtable.
public synchronized  booleanequals(Object object)
     Compares the specified object to this Hashtable and answer if they are equal.
public synchronized  Vget(Object key)
     Answers the value associated with the specified key in this Hashtable.
 Entry<K, V>getEntry(Object key)
    
public synchronized  inthashCode()
     Answers an integer hash code for the receiver.
public synchronized  booleanisEmpty()
     Answers if this Hashtable has no key/value pairs, a size of zero.
public  Set<K>keySet()
     Answers a Set of the keys contained in this Hashtable.
public synchronized  Enumeration<K>keys()
     Answers an Enumeration on the keys of this Hashtable.
public synchronized  Vput(K key, V value)
     Associate the specified value with the specified key in this Hashtable. If the key already exists, the old value is replaced.
public synchronized  voidputAll(Map<? extends K, ? extends V> map)
     Copies every mapping in the specified Map to this Hashtable.
protected  voidrehash()
     Increases the capacity of this Hashtable.
public synchronized  Vremove(Object key)
     Remove the key/value pair with the specified key from this Hashtable.
public synchronized  intsize()
     Answers the number of key/value pairs in this Hashtable.
public synchronized  StringtoString()
     Answers the string representation of this Hashtable.
public  Collection<V>values()
     Answers a Collection of the values contained in this Hashtable.

Field Detail
elementCount
transient int elementCount(Code)



elementData
transient Entry<K, V>[] elementData(Code)



firstSlot
transient int firstSlot(Code)



lastSlot
transient int lastSlot(Code)



modCount
transient int modCount(Code)




Constructor Detail
Hashtable
public Hashtable()(Code)
Constructs a new Hashtable using the default capacity and load factor.



Hashtable
public Hashtable(int capacity)(Code)
Constructs a new Hashtable using the specified capacity and the default load factor.
Parameters:
  capacity - the initial capacity



Hashtable
public Hashtable(int capacity, float loadFactor)(Code)
Constructs a new Hashtable using the specified capacity and load factor.
Parameters:
  capacity - the initial capacity
Parameters:
  loadFactor - the initial load factor



Hashtable
public Hashtable(Map<? extends K, ? extends V> map)(Code)
Constructs a new instance of Hashtable containing the mappings from the specified Map.
Parameters:
  map - the mappings to add




Method Detail
clear
public synchronized void clear()(Code)
Removes all key/value pairs from this Hashtable, leaving the size zero and the capacity unchanged.
See Also:   Hashtable.isEmpty
See Also:   Hashtable.size



clone
public synchronized Object clone()(Code)
Answers a new Hashtable with the same key/value pairs, capacity and load factor. a shallow copy of this Hashtable
See Also:   java.lang.Cloneable



contains
public synchronized boolean contains(Object value)(Code)
Answers if this Hashtable contains the specified object as the value of at least one of the key/value pairs.
Parameters:
  value - the object to look for as a value in this Hashtable true if object is a value in this Hashtable, false otherwise
See Also:   Hashtable.containsKey
See Also:   java.lang.Object.equals



containsKey
public synchronized boolean containsKey(Object key)(Code)
Answers if this Hashtable contains the specified object as a key of one of the key/value pairs.
Parameters:
  key - the object to look for as a key in this Hashtable true if object is a key in this Hashtable, false otherwise
See Also:   Hashtable.contains
See Also:   java.lang.Object.equals



containsValue
public boolean containsValue(Object value)(Code)
Searches this Hashtable for the specified value.
Parameters:
  value - the object to search for true if value is a value of this Hashtable, falseotherwise



elements
public synchronized Enumeration<V> elements()(Code)
Answers an Enumeration on the values of this Hashtable. The results of the Enumeration may be affected if the contents of this Hashtable are modified. an Enumeration of the values of this Hashtable
See Also:   Hashtable.keys
See Also:   Hashtable.size
See Also:   Enumeration



entrySet
public Set<Map.Entry<K, V>> entrySet()(Code)
Answers a Set of the mappings contained in this Hashtable. Each element in the set is a Map.Entry. The set is backed by this Hashtable so changes to one are reflected by the other. The set does not support adding. a Set of the mappings



equals
public synchronized boolean equals(Object object)(Code)
Compares the specified object to this Hashtable and answer if they are equal. The object must be an instance of Map and contain the same key/value pairs.
Parameters:
  object - the object to compare with this object true if the specified object is equal to this Map, falseotherwise
See Also:   Hashtable.hashCode



get
public synchronized V get(Object key)(Code)
Answers the value associated with the specified key in this Hashtable.
Parameters:
  key - the key of the value returned the value associated with the specified key, null if thespecified key does not exist
See Also:   Hashtable.put



getEntry
Entry<K, V> getEntry(Object key)(Code)



hashCode
public synchronized int hashCode()(Code)
Answers an integer hash code for the receiver. Objects which are equal answer the same value for this method. the receiver's hash
See Also:   Hashtable.equals



isEmpty
public synchronized boolean isEmpty()(Code)
Answers if this Hashtable has no key/value pairs, a size of zero. true if this Hashtable has no key/value pairs, false otherwise
See Also:   Hashtable.size



keySet
public Set<K> keySet()(Code)
Answers a Set of the keys contained in this Hashtable. The set is backed by this Hashtable so changes to one are reflected by the other. The set does not support adding. a Set of the keys



keys
public synchronized Enumeration<K> keys()(Code)
Answers an Enumeration on the keys of this Hashtable. The results of the Enumeration may be affected if the contents of this Hashtable are modified. an Enumeration of the keys of this Hashtable
See Also:   Hashtable.elements
See Also:   Hashtable.size
See Also:   Enumeration



put
public synchronized V put(K key, V value)(Code)
Associate the specified value with the specified key in this Hashtable. If the key already exists, the old value is replaced. The key and value cannot be null.
Parameters:
  key - the key to add
Parameters:
  value - the value to add the old value associated with the specified key, null if the keydid not exist
See Also:   Hashtable.elements
See Also:   Hashtable.get
See Also:   Hashtable.keys
See Also:   java.lang.Object.equals



putAll
public synchronized void putAll(Map<? extends K, ? extends V> map)(Code)
Copies every mapping in the specified Map to this Hashtable.
Parameters:
  map - the Map to copy mappings from



rehash
protected void rehash()(Code)
Increases the capacity of this Hashtable. This method is sent when the size of this Hashtable exceeds the load factor.



remove
public synchronized V remove(Object key)(Code)
Remove the key/value pair with the specified key from this Hashtable.
Parameters:
  key - the key to remove the value associated with the specified key, null if thespecified key did not exist
See Also:   Hashtable.get
See Also:   Hashtable.put



size
public synchronized int size()(Code)
Answers the number of key/value pairs in this Hashtable. the number of key/value pairs in this Hashtable
See Also:   Hashtable.elements
See Also:   Hashtable.keys



toString
public synchronized String toString()(Code)
Answers the string representation of this Hashtable. the string representation of this Hashtable



values
public Collection<V> values()(Code)
Answers a Collection of the values contained in this Hashtable. The collection is backed by this Hashtable so changes to one are reflected by the other. The collection does not support adding. a Collection of the values



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.