Android
java.util.jar
public class

java.util.jar.Attributes

java.lang.Object
java.util.jar.Attributes Cloneable Map<K, V>

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

protected      Map<ObjectObject map   

Public Constructors

            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

Public Methods

          void  clear()
Removes all key/value pairs from this Attributes.
          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.
          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<Entry<ObjectObject>>  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(String name)
Returns the String associated with the parameter name.
          String  getValue(Attributes.Name name)
Returns the value associated with the parameter Attributes.Name key.
          int  hashCode()
Returns the hashCode 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)
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<Object values()
Returns a Collection of all the values present in this Attributes.
Methods inherited from class java.lang.Object
Methods inherited from interface java.util.Map

Details

Fields

protected Map<ObjectObject> map

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

public Set<Entry<ObjectObject>> entrySet()

Returns a set containing MapEntry's for each of the key/value pairs contained in this Attributes.

Returns

  • a set of MapEntry's

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

public Object get(Object key)

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.

public String getValue(String name)

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

public String getValue(Attributes.Name name)

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

public Set<Object> keySet()

Returns a Set containing all the keys found in this Attributes.

Returns

  • a Set of all keys

public Object put(Object key, Object value)

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

Returns

  • The value being stored

Throws

ClassCastException when key is not an Attributes.Name or value is not a String

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).

public String putValue(String name, String val)

Stores value val against key name in this Attributes

Parameters

name The key to store against.
val The value to store in this Attributes

Returns

  • the Value being stored

public Object remove(Object key)

Deletes the key/value pair with key key from this Attributes.

Parameters

key The key to remove

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

public Collection<Object> values()

Returns a Collection of all the values present in this Attributes.

Returns

  • a Collection of all values present
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56