| Modifier and Type | Class and Description |
|---|---|
static class |
Attributes.Name
The name part of the name/value pairs constituting an attribute as
defined by the specification of the JAR manifest.
|
| Modifier and Type | Field and Description |
|---|---|
protected Map<Object,Object> |
map
The
Attributes as name/value pairs. |
| Constructor and Description |
|---|
Attributes()
Constructs an
Attributes instance. |
Attributes(Attributes attrib)
Constructs an
Attributes instance obtaining keys and values from
the parameter 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()
Creates and returns a copy of this
Object. |
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<Map.Entry<Object,Object>> |
entrySet()
Returns a set containing map entries for each of the key/value pair
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 hash code of this
Attributes. |
boolean |
isEmpty()
Determines whether this
Attributes contains any keys. |
Set<Object> |
keySet()
Returns a
Set containing all the keys found in this Attributes. |
Object |
put(Object key,
Object value)
Stores key/value pairs in this
Attributes. |
void |
putAll(Map<?,?> attrib)
Stores all the key/value pairs in the argument in this
Attributes. |
String |
putValue(String name,
String value)
Stores the value
value associated with the 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<Object> |
values()
Returns a collection of all the values present in this
Attributes. |
protected Map<Object,Object> map
Attributes as name/value pairs. Maps the attribute names (as
Attributes.Name) of a JAR file manifest to arbitrary values. The
attribute names thus are obtained from the Manifest for
convenience.public Attributes()
Attributes instance.public Attributes(Attributes attrib)
Attributes instance obtaining keys and values from
the parameter attrib.attrib - The attributes to obtain entries from.public Attributes(int size)
Attributes instance with initial capacity of size
size.size - Initial size of this Attributes instance.public void clear()
Attributes.public boolean containsKey(Object key)
Attributes contains the specified key.containsKey in interface Map<Object,Object>key - The key to search for.true if the key is found, false otherwise.public boolean containsValue(Object value)
Attributes contains the specified value.containsValue in interface Map<Object,Object>value - the value to search for.true if the value is found, false otherwise.public Set<Map.Entry<Object,Object>> entrySet()
Attributes.public boolean isEmpty()
Attributes contains any keys.public Object put(Object key, Object value)
Attributes.put in interface Map<Object,Object>key - the key to associate with value.value - the value to store in this Attributes.ClassCastException - when key is not an Attributes.Name or value is not
a String.public void putAll(Map<?,?> attrib)
Attributes.public Object remove(Object key)
key from this Attributes.public int size()
Attributes.public Collection<Object> values()
Attributes.public Object clone()
ObjectObject. The default
implementation returns a so-called "shallow" copy: It creates a new
instance of the same class and then copies the field values (including
object references) from this instance to the new instance. A "deep" copy,
in contrast, would also recursively clone nested objects. A subclass that
needs to implement this kind of cloning should call super.clone()
to create the new instance and then create deep copies of the nested,
mutable objects.public int hashCode()
Attributes.public boolean equals(Object obj)
Attributes and the parameter Attributes are equal. Two Attributes instances are equal if they
contain the same keys and values.public String getValue(Attributes.Name name)
Attributes.Name
key.name - the key to obtain the value for.String associated with name, or null if name
is not a valid key.public String getValue(String name)
name - the key to obtain the value for.null if name is not a
valid key.