java.util.jar
public
class
java.util.jar.Attributes
The Attributes class is used to store values for Manifest entries. Attributes
keys are generally instances of Attributes.Name. Values associated with
Attributes keys are of type String.
Nested Classes
Summary
Fields
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Methods inherited
from interface
java.util.Map
clear,
containsKey,
containsValue,
entrySet,
equals,
get,
hashCode,
isEmpty,
keySet,
put,
putAll,
remove,
size,
values
Details
Fields
Public Constructors
public
Attributes()
Constructs an Attributes instance
public
Attributes(Attributes attrib)
Constructs an Attributes instance obtaining keys and values from the
parameter Attributes, attrib
Parameters
attrib
| The Attributes to obtain entries from.
|
public
Attributes(int size)
Constructs an Attributes instance with initial capacity of size size
Parameters
size
| Initial size of this Attributes instance.
|
Public Methods
public
void
clear()
Removes all key/value pairs from this Attributes.
public
Object
clone()
Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
Classes which wish to support cloning must specify that they implement
the Cloneable interface, since the implementation checks for this.
Returns
- Object a shallow copy of this object.
public
boolean
containsKey(Object key)
Determines whether this Attributes contains the specified key
Parameters
key
| The key to search for. |
Returns
- true if the key is found, false otherwise
public
boolean
containsValue(Object value)
Determines whether this Attributes contains the specified value
Parameters
value
| The value to search for. |
Returns
- true if the value is found, false otherwise
Returns a set containing MapEntry's for each of the key/value pairs
contained in this Attributes.
public
boolean
equals(Object obj)
Determines if this Attributes and the parameter Attributes are equal. Two
Attributes instances are equal if they contain the same keys and values.
Parameters
obj
| Object the object to compare with this object. |
Returns
- true if the Attributes are equals, false otherwise
Returns the value associated with the parameter key
Parameters
key
| The key to search for. |
Returns
- Object associated with key, or null if key does not exist.
Returns the String associated with the parameter name.
Parameters
name
| The key to obtain the value for. |
Returns
- the String associated with name, or null if name is not a valid
key
Returns the value associated with the parameter Attributes.Name key.
Parameters
name
| The key to obtain the value for. |
Returns
- the String associated with name, or null if name is not a valid
key
public
int
hashCode()
Returns the hashCode of this Attributes
Returns
- the hashCode of this Object.
public
boolean
isEmpty()
Determines whether this Attributes contains any keys
Returns
- true if one or more keys exist, false otherwise
Returns a Set containing all the keys found in this Attributes.
Store value in this Attributes and associate it with key.
Parameters
key
| The key to associate with value. |
value
| The value to store in this Attributes |
public
void
putAll(Map<?, ?> attrib)
Store all the key.value pairs in the argument in this Attributes.
Parameters
attrib
| the associations to store (must be of type Attributes).
|
Stores value val against key name in this Attributes
Parameters
name
| The key to store against. |
val
| The value to store in this Attributes |
Deletes the key/value pair with key key from this Attributes.
Returns
- the values associated with the removed key, null if not present.
public
int
size()
Returns the number of key.value pairs associated with this Attributes.
Returns
- the size of this Attributes
Returns a Collection of all the values present in this Attributes.
Returns
- a Collection of all values present