Modifier and Type | Class and Description |
---|---|
static class |
Attributes.Name |
Constructor and Description |
---|
Attributes()
Constructs an Attributes instance
|
Attributes(Attributes attrib)
Constructs an Attributes instance obtaining keys and values from the
parameter Attributes, attrib
|
Attributes(int size)
Constructs an Attributes instance with initial capacity of size size
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all key/value pairs from this Attributes.
|
Object |
clone()
Default clone() method performs a "shallow" cloning of the instance.
|
boolean |
containsKey(Object key)
Determines whether this Attributes contains the specified key
|
boolean |
containsValue(Object value)
Determines whether this Attributes contains the specified value
|
Set |
entrySet()
Returns a set containing MapEntry's for each of the key/value pairs
contained in this Attributes.
|
boolean |
equals(Object obj)
Determines if this Attributes and the parameter Attributes are equal.
|
Object |
get(Object key)
Returns the value associated with the parameter key
|
String |
getValue(Attributes.Name name)
Returns the value associated with the parameter Attributes.Name key.
|
String |
getValue(String name)
Returns the String associated with the parameter name.
|
int |
hashCode()
Returns the hashCode of this Attributes
|
boolean |
isEmpty()
Determines whether this Attributes contains any keys
|
Set |
keySet()
Returns a Set containing all the keys found in this Attributes.
|
Object |
put(Object key,
Object value)
Store value in this Attributes and associate it with key.
|
void |
putAll(Map attrib)
Store all the key.value pairs in the argument in this Attributes.
|
String |
putValue(String name,
String val)
Stores value val against key name in this Attributes
|
Object |
remove(Object key)
Deletes the key/value pair with key key from this Attributes.
|
int |
size()
Returns the number of key.value pairs associated with this Attributes.
|
Collection |
values()
Returns a Collection of all the values present in this Attributes.
|
protected Map map
public Attributes()
public Attributes(Attributes attrib)
attrib
- The Attributes to obtain entries from.public Attributes(int size)
size
- Initial size of this Attributes instance.public void clear()
public boolean containsKey(Object key)
containsKey
in interface Map
key
- The key to search for.public boolean containsValue(Object value)
containsValue
in interface Map
value
- The value to search for.public Set entrySet()
public boolean isEmpty()
public Set keySet()
public Object put(Object key, Object value)
put
in interface Map
key
- The key to associate with value.value
- The value to store in this AttributesClassCastException
- when key is not an Attributes.Name or value is not a
Stringpublic void putAll(Map attrib)
public Object remove(Object key)
public int size()
public Collection values()
public Object clone()
Object
public int hashCode()
public boolean equals(Object obj)
public String getValue(Attributes.Name name)
name
- The key to obtain the value for.public String getValue(String name)
name
- The key to obtain the value for.