public class MapFromString extends UntypedMap
An untyped map, intended for internal use by strongly-typed maps which inherit from the MapBase
class.
Constructor and Description |
---|
MapFromString(int capacity)
Construct a new map with
MapFromString.size of zero and specified initial capacity . |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all entries from this map.
|
void |
copyKeysTo(UntypedList list)
Copy the keys in this map to the
list argument. |
void |
copyValuesTo(UntypedList list)
Copy the values in this map to the
list argument. |
boolean |
delete(java.lang.Object key)
Delete the entry with the specified
key (if found). |
boolean |
deleteWithString(java.lang.String key)
For internal use only.
|
java.lang.Object |
get(java.lang.Object key)
Return (nullable) The entry with the specified
key (if found), otherwise null . |
java.lang.Object |
getRequired(java.lang.Object key)
Return the entry with the specified
key (if found). |
java.lang.Object |
getRequiredWithString(java.lang.String key)
For internal use only.
|
java.lang.Object |
getWithString(java.lang.String key)
For internal use only.
|
boolean |
has(java.lang.Object key)
Return
true if this map has an entry with the specified key , otherwise false . |
boolean |
hasWithString(java.lang.String key)
For internal use only.
|
boolean |
isEmpty()
true if this map contains no entries. |
boolean |
isMutable()
true if this map is mutable. |
MapIteratorFromString |
iteratorFromString()
For internal use only.
|
UntypedList |
keys()
Return a list of the entry keys in this map.
|
void |
set(java.lang.Object key,
java.lang.Object value)
Add or replace an entry with the specified
key and value . |
void |
setWithString(java.lang.String key,
java.lang.Object value)
For internal use only.
|
int |
size()
The number of entries in this map.
|
java.lang.String |
toString()
Return a string representation of this map.
|
UntypedList |
values()
Return a list of the entry values in this map.
|
public MapFromString(int capacity)
Construct a new map with MapFromString.size
of zero and specified initial capacity
.
A map can expand in size beyond its initial capacity, but best performance
will be obtained if the initial capacity is close to the map's maximum size.
capacity
- Initial capacity.public void clear()
Remove all entries from this map.
clear
in class UntypedMap
public void copyKeysTo(UntypedList list)
Copy the keys in this map to the list
argument.
copyKeysTo
in class UntypedMap
list
- List to receive copied keys.public void copyValuesTo(UntypedList list)
Copy the values in this map to the list
argument.
copyValuesTo
in class UntypedMap
list
- List to receive copied values.public boolean delete(java.lang.Object key)
Delete the entry with the specified key
(if found).
delete
in class UntypedMap
key
- (nullable) Entry key.true
if an entry with the specified key
was found (and deleted).public boolean deleteWithString(java.lang.String key)
For internal use only.
public java.lang.Object get(java.lang.Object key)
Return (nullable) The entry with the specified key
(if found), otherwise null
.
get
in class UntypedMap
key
- (nullable) Entry key.key
(if found), otherwise null
.public java.lang.Object getRequired(java.lang.Object key)
Return the entry with the specified key
(if found).
MissingEntryException
if no entry is found for the specified key.
getRequired
in class UntypedMap
key
- (nullable) Entry key.public java.lang.Object getRequiredWithString(java.lang.String key)
For internal use only.
public java.lang.Object getWithString(java.lang.String key)
For internal use only.
public boolean has(java.lang.Object key)
Return true
if this map has an entry with the specified key
, otherwise false
.
has
in class UntypedMap
key
- (nullable) Entry key.true
if this map has an entry with the specified key
, otherwise false
.public boolean hasWithString(java.lang.String key)
For internal use only.
public boolean isEmpty()
true
if this map contains no entries.
isEmpty
in class UntypedMap
public boolean isMutable()
true
if this map is mutable.
isMutable
in class UntypedMap
public MapIteratorFromString iteratorFromString()
For internal use only.
public UntypedList keys()
Return a list of the entry keys in this map.
keys
in class UntypedMap
public void set(java.lang.Object key, java.lang.Object value)
Add or replace an entry with the specified key
and value
.
set
in class UntypedMap
key
- (nullable) Entry key.value
- (nullable) Entry value.public void setWithString(java.lang.String key, java.lang.Object value)
For internal use only.
public int size()
The number of entries in this map.
size
in class UntypedMap
public java.lang.String toString()
Return a string representation of this map.
toString
in class UntypedMap
public UntypedList values()
Return a list of the entry values in this map.
values
in class UntypedMap