src/java.base/share/classes/java/util/Hashtable.java
changeset 58242 94bb65cb37d3
parent 57956 e0b8b019d2f5
child 58679 9c3209ff7550
equal deleted inserted replaced
58241:33de7752835c 58242:94bb65cb37d3
   178      * Constructs a new, empty hashtable with the specified initial
   178      * Constructs a new, empty hashtable with the specified initial
   179      * capacity and the specified load factor.
   179      * capacity and the specified load factor.
   180      *
   180      *
   181      * @param      initialCapacity   the initial capacity of the hashtable.
   181      * @param      initialCapacity   the initial capacity of the hashtable.
   182      * @param      loadFactor        the load factor of the hashtable.
   182      * @param      loadFactor        the load factor of the hashtable.
   183      * @exception  IllegalArgumentException  if the initial capacity is less
   183      * @throws     IllegalArgumentException  if the initial capacity is less
   184      *             than zero, or if the load factor is nonpositive.
   184      *             than zero, or if the load factor is nonpositive.
   185      */
   185      */
   186     public Hashtable(int initialCapacity, float loadFactor) {
   186     public Hashtable(int initialCapacity, float loadFactor) {
   187         if (initialCapacity < 0)
   187         if (initialCapacity < 0)
   188             throw new IllegalArgumentException("Illegal Capacity: "+
   188             throw new IllegalArgumentException("Illegal Capacity: "+
   200     /**
   200     /**
   201      * Constructs a new, empty hashtable with the specified initial capacity
   201      * Constructs a new, empty hashtable with the specified initial capacity
   202      * and default load factor (0.75).
   202      * and default load factor (0.75).
   203      *
   203      *
   204      * @param     initialCapacity   the initial capacity of the hashtable.
   204      * @param     initialCapacity   the initial capacity of the hashtable.
   205      * @exception IllegalArgumentException if the initial capacity is less
   205      * @throws    IllegalArgumentException if the initial capacity is less
   206      *              than zero.
   206      *              than zero.
   207      */
   207      */
   208     public Hashtable(int initialCapacity) {
   208     public Hashtable(int initialCapacity) {
   209         this(initialCapacity, 0.75f);
   209         this(initialCapacity, 0.75f);
   210     }
   210     }
   302      * @param      value   a value to search for
   302      * @param      value   a value to search for
   303      * @return     {@code true} if and only if some key maps to the
   303      * @return     {@code true} if and only if some key maps to the
   304      *             {@code value} argument in this hashtable as
   304      *             {@code value} argument in this hashtable as
   305      *             determined by the {@code equals} method;
   305      *             determined by the {@code equals} method;
   306      *             {@code false} otherwise.
   306      *             {@code false} otherwise.
   307      * @exception  NullPointerException  if the value is {@code null}
   307      * @throws     NullPointerException  if the value is {@code null}
   308      */
   308      */
   309     public synchronized boolean contains(Object value) {
   309     public synchronized boolean contains(Object value) {
   310         if (value == null) {
   310         if (value == null) {
   311             throw new NullPointerException();
   311             throw new NullPointerException();
   312         }
   312         }
   463      *
   463      *
   464      * @param      key     the hashtable key
   464      * @param      key     the hashtable key
   465      * @param      value   the value
   465      * @param      value   the value
   466      * @return     the previous value of the specified key in this hashtable,
   466      * @return     the previous value of the specified key in this hashtable,
   467      *             or {@code null} if it did not have one
   467      *             or {@code null} if it did not have one
   468      * @exception  NullPointerException  if the key or value is
   468      * @throws     NullPointerException  if the key or value is
   469      *               {@code null}
   469      *               {@code null}
   470      * @see     Object#equals(Object)
   470      * @see     Object#equals(Object)
   471      * @see     #get(Object)
   471      * @see     #get(Object)
   472      */
   472      */
   473     public synchronized V put(K key, V value) {
   473     public synchronized V put(K key, V value) {