|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.util.jar.Attributes
, Map
<Object
,Object
>public class Attributes

<Object
,Object
>, Cloneable

The Attributes class maps Manifest attribute names to associated string values. Valid attribute names are case-insensitive, are restricted to the ASCII characters in the set [0-9a-zA-Z_-], and cannot exceed 70 characters in length. Attribute values can contain any characters and will be UTF8-encoded when written to the output stream. See the JAR File Specification for more information about valid attribute names and values.
Manifest

| Nested Class Summary | |
|---|---|
static class |
Attributes.Name
The Attributes.Name class represents an attribute name stored in this Map. |
Nested classes/interfaces inherited from interface java.util.Map ![]() |
|---|
Map.Entry |
| Field Summary | |
|---|---|
protected Map |
map
The attribute name-value mappings. |
| Constructor Summary | |
|---|---|
Attributes
Constructs a new, empty Attributes object with default size. |
|
Attributes
Constructs a new Attributes object with the same attribute name-value mappings as in the specified Attributes. |
|
Attributes
Constructs a new, empty Attributes object with the specified initial size. |
|
| Method Summary | |
|---|---|
void |
clear
Removes all attributes from this Map. |
Object |
clone
Returns a copy of the Attributes, implemented as follows: |
boolean |
containsKey
Returns true if this Map contains the specified attribute name (key). |
boolean |
containsValue
Returns true if this Map maps one or more attribute names (keys) to the specified value. |
Set |
entrySet
Returns a Collection view of the attribute name-value mappings contained in this Map. |
boolean |
equals
Compares the specified Attributes object with this Map for equality. |
Object |
get
Returns the value of the specified attribute name, or null if the attribute name was not found. |
String |
getValue
Returns the value of the specified Attributes.Name, or null if the attribute was not found. |
String |
getValue
Returns the value of the specified attribute name, specified as a string, or null if the attribute was not found. |
int |
hashCode
Returns the hash code value for this Map. |
boolean |
isEmpty
Returns true if this Map contains no attributes. |
Set |
keySet
Returns a Set view of the attribute names (keys) contained in this Map. |
Object |
put
Associates the specified value with the specified attribute name (key) in this Map. |
void |
putAll
Copies all of the attribute name-value mappings from the specified Attributes to this Map. |
String |
putValue
Associates the specified value with the specified attribute name, specified as a String. |
Object |
remove
Removes the attribute with the specified name (key) from this Map. |
int |
size
Returns the number of attributes in this Map. |
Collection |
values
Returns a Collection view of the attribute values contained in this Map. |
Methods inherited from class java.lang.Object ![]() |
|---|
finalize |
| Field Detail |
|---|

protected Map![]()
![]()
<Object
![]()
![]()
,Object
![]()
![]()
> map
| Constructor Detail |
|---|

public Attributes()

public Attributes(int size)
size - the initial number of attributes

public Attributes(Attributes![]()
![]()
attr)
attr - the specified Attributes| Method Detail |
|---|

public Object![]()
![]()
get(Object
![]()
![]()
name)
get

in interface Map
<Object
,Object
>name - the attribute name
Map.containsKey(Object)


public String![]()
![]()
getValue(String
![]()
![]()
name)
This method is defined as:
return (String)get(new Attributes.Name((String)name));
name - the attribute name as a string
IllegalArgumentException

- if the attribute name is invalid

public String![]()
![]()
getValue(Attributes.Name
![]()
![]()
name)
This method is defined as:
return (String)get(name);
name - the Attributes.Name object

public Object![]()
![]()
put(Object
![]()
![]()
name, Object
![]()
![]()
value)
put

in interface Map
<Object
,Object
>name - the attribute namevalue - the attribute value
ClassCastException

- if the name is not a Attributes.Name
or the value is not a String

public String![]()
![]()
putValue(String
![]()
![]()
name, String
![]()
![]()
value)
This method is defined as:
return (String)put(new Attributes.Name(name), value);
name - the attribute name as a stringvalue - the attribute value
IllegalArgumentException

- if the attribute name is invalid

public Object![]()
![]()
remove(Object
![]()
![]()
name)
remove

in interface Map
<Object
,Object
>name - attribute name

public boolean containsValue(Object![]()
![]()
value)
containsValue

in interface Map
<Object
,Object
>value - the attribute value

public boolean containsKey(Object![]()
![]()
name)
containsKey

in interface Map
<Object
,Object
>name - the attribute name

public void putAll(Map![]()
![]()
<?,?> attr)
putAll

in interface Map
<Object
,Object
>attr - the Attributes to be stored in this map
ClassCastException

- if attr is not an Attributes

public void clear()
clear

in interface Map
<Object
,Object
>

public int size()
size

in interface Map
<Object
,Object
>

public boolean isEmpty()
isEmpty

in interface Map
<Object
,Object
>

public Set![]()
![]()
<Object
![]()
![]()
> keySet()
keySet

in interface Map
<Object
,Object
>

public Collection![]()
![]()
<Object
![]()
![]()
> values()
values

in interface Map
<Object
,Object
>

public Set![]()
![]()
<Map.Entry
![]()
![]()
<Object
![]()
![]()
,Object
![]()
![]()
>> entrySet()
entrySet

in interface Map
<Object
,Object
>

public boolean equals(Object![]()
![]()
o)
equals

in interface Map
<Object
,Object
>equals

in class Object

o - the Object to be compared
Object.hashCode()
,
Hashtable


public int hashCode()
hashCode

in interface Map
