K
- type of the key
entries.V
- public class XdevHashtable<K,V> extends Hashtable<K,V> implements Copyable<XdevHashtable<K,V>>
Map
,
Hashtable
,
Serialized FormConstructor and Description |
---|
XdevHashtable()
Constructs a new, empty
XdevHashtable with a default initial
capacity (11) and load factor (0.75). |
XdevHashtable(int initialCapacity)
Constructs a new, empty
XdevHashtable with the specified initial
capacity and default load factor (0.75). |
XdevHashtable(Map<? extends K,? extends V> m)
Constructs a new
XdevHashtable with the same mappings as the
given Map. |
XdevHashtable(Object... keysAndValues)
Constructs a new
XdevHashtable with the given value pairs. |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
XdevHashtable<K,V> |
clone()
Returns a field-for-field copy of this instance.
|
XdevHashtable<K,V> |
copy()
Creates a (defensive) copy of this
XdevHashtable . |
K |
getKey()
Returns the
key at the current cursor position. |
XdevList<K> |
getKeys()
|
V |
getValue()
Returns the
value at the current cursor position. |
XdevList<V> |
getValues()
|
boolean |
next()
Tests if this
XdevHashtable contains more elements. |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> t) |
V |
remove(Object key) |
void |
resetCursor()
Resets the cursor for this
XdevHashtable . |
String |
toString() |
String |
toString(String separator)
Returns a
String representation of all elements of this
XdevHashtable separated by the specified separator. |
compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, putIfAbsent, rehash, remove, replace, replace, replaceAll, size, values
public XdevHashtable()
XdevHashtable
with a default initial
capacity (11) and load factor (0.75).public XdevHashtable(int initialCapacity) throws IllegalArgumentException
XdevHashtable
with the specified initial
capacity and default load factor (0.75).initialCapacity
- the initial capacity of the XdevHashtable
.IllegalArgumentException
- if the initial capacity is less than zero.public XdevHashtable(Map<? extends K,? extends V> m) throws NullPointerException
XdevHashtable
with the same mappings as the
given Map. The XdevHashtable is created with an initial capacity
sufficient to hold the mappings in the given Map and a default load
factor (0.75).m
- the map whose mappings are to be placed in this map.NullPointerException
- if the specified map is null.public XdevHashtable(Object... keysAndValues) throws IllegalArgumentException
XdevHashtable
with the given value pairs. The
given parameters become paired in the order that they are passed to the
method. The first parameter will be the key, the second parameter will be
the value for the first pair (and so on)...keysAndValues
- key value pairs in sequenceIllegalArgumentException
- if the parameter count is not even.public void clear()
public XdevList<K> getKeys()
XdevList
containing all the keys
of this
XdevHashtable
.public XdevList<V> getValues()
XdevList
containing all the values
of this
XdevHashtable
.public void resetCursor()
XdevHashtable
.public boolean next()
XdevHashtable
contains more elements.
If this XdevHashtable
contains more elements, the cursor is set
to next element; otherwise the cursor is reseted via
resetCursor()
.
true
if and only if this XdevHashtable
object contains at least one more element to provide;
false
otherwise.public K getKey()
key
at the current cursor position.key
at the current cursor position.next()
,
resetCursor()
public V getValue()
value
at the current cursor position.value
at the current cursor position.next()
,
resetCursor()
public String toString(String separator)
String
representation of all elements of this
XdevHashtable
separated by the specified separator.separator
- String to separated the list elements.String
representation of all elements of this
XdevHashtable
separated by the specified separator.public XdevHashtable<K,V> copy()
XdevHashtable
.XdevHashtable
.Copyright © 2003–2021 XDEV Software. All rights reserved.