English | Site Directory

Android - An Open Handset Alliance Project

android.util
public class

android.util.XmlPullAttributes

java.lang.Object
android.util.XmlPullAttributes AttributeSet

Provides an implementation of AttributeSet on top of an XmlPullParser.

Summary

Public Constructors

          XmlPullAttributes(XmlPullParser parser)

Public Methods

        boolean  getAttributeBooleanValue(String namespace, String attribute, boolean defaultValue)
Return the boolean value of 'attribute'.
        boolean  getAttributeBooleanValue(int index, boolean defaultValue)
Return the boolean value of attribute at 'index'.
        int  getAttributeCount()
        float  getAttributeFloatValue(int index, float defaultValue)
Return the float value of attribute at 'index'.
        float  getAttributeFloatValue(String namespace, String attribute, float defaultValue)
Return the float value of 'attribute'.
        int  getAttributeIntValue(int index, int defaultValue)
Return the integer value of attribute at 'index'.
        int  getAttributeIntValue(String namespace, String attribute, int defaultValue)
Return the integer value of 'attribute'.
        int  getAttributeListValue(String namespace, String attribute, String[] options, int defaultValue)
Return the index of the value of 'attribute' in the list 'options'.
        int  getAttributeListValue(int index, String[] options, int defaultValue)
Return the index of the value of attribute at 'index' in the list 'options'.
        String  getAttributeName(int index)
        int  getAttributeNameResource(int index)
Return the resource ID associated with the given attribute name.
        int  getAttributeResourceValue(String namespace, String attribute, int defaultValue)
Return the value of 'attribute' as a resource identifier.
        int  getAttributeResourceValue(int index, int defaultValue)
Return the value of attribute at 'index' as a resource identifier.
        int  getAttributeUnsignedIntValue(String namespace, String attribute, int defaultValue)
Return the boolean value of 'attribute' that is formatted as an unsigned value.
        int  getAttributeUnsignedIntValue(int index, int defaultValue)
Return the integer value of attribute at 'index' that is formatted as an unsigned value.
        String  getAttributeValue(String namespace, String name)
        String  getAttributeValue(int index)
        String  getClassAttribute()
Return the value of the "class" attribute or null if there is not one.
        String  getIdAttribute()
Return the value of the "id" attribute or null if there is not one.
        int  getIdAttributeResourceValue(int defaultValue)
Return the integer value of the "id" attribute or defaultValue if there is none.
        String  getPositionDescription()
        int  getStyleAttribute()
Return the value of the "style" attribute or 0 if there is not one.
Methods inherited from class java.lang.Object
Methods inherited from interface android.util.AttributeSet

Details

Public Constructors

public XmlPullAttributes(XmlPullParser parser)

Public Methods

public boolean getAttributeBooleanValue(String namespace, String attribute, boolean defaultValue)

Return the boolean value of 'attribute'.

public boolean getAttributeBooleanValue(int index, boolean defaultValue)

Return the boolean value of attribute at 'index'.

public int getAttributeCount()

public float getAttributeFloatValue(int index, float defaultValue)

Return the float value of attribute at 'index'.

public float getAttributeFloatValue(String namespace, String attribute, float defaultValue)

Return the float value of 'attribute'.

public int getAttributeIntValue(int index, int defaultValue)

Return the integer value of attribute at 'index'.

public int getAttributeIntValue(String namespace, String attribute, int defaultValue)

Return the integer value of 'attribute'.

public int getAttributeListValue(String namespace, String attribute, String[] options, int defaultValue)

Return the index of the value of 'attribute' in the list 'options'.

public int getAttributeListValue(int index, String[] options, int defaultValue)

Return the index of the value of attribute at 'index' in the list 'options'.

public String getAttributeName(int index)

public int getAttributeNameResource(int index)

Return the resource ID associated with the given attribute name. This will be the identifier for an attribute resource, which can be used by styles. Returns 0 if there is no resource associated with this attribute.

Note that this is different than getAttributeResourceValue(int, int) in that it returns a resource identifier for the attribute name; the other method returns this attribute's value as a resource identifier.

public int getAttributeResourceValue(String namespace, String attribute, int defaultValue)

Return the value of 'attribute' as a resource identifier.

Note that this is different than getAttributeNameResource(int) in that it returns a the value contained in this attribute as a resource identifier (i.e., a value originally of the form "@package:type/resource"); the other method returns a resource identifier that identifies the name of the attribute.

public int getAttributeResourceValue(int index, int defaultValue)

Return the value of attribute at 'index' as a resource identifier.

Note that this is different than getAttributeNameResource(int) in that it returns a the value contained in this attribute as a resource identifier (i.e., a value originally of the form "@package:type/resource"); the other method returns a resource identifier that identifies the name of the attribute.

public int getAttributeUnsignedIntValue(String namespace, String attribute, int defaultValue)

Return the boolean value of 'attribute' that is formatted as an unsigned value. In particular, the formats 0xn...n and #n...n are handled.

public int getAttributeUnsignedIntValue(int index, int defaultValue)

Return the integer value of attribute at 'index' that is formatted as an unsigned value. In particular, the formats 0xn...n and #n...n are handled.

public String getAttributeValue(String namespace, String name)

public String getAttributeValue(int index)

public String getClassAttribute()

Return the value of the "class" attribute or null if there is not one. Equivalent to getAttributeValue(null, "class").

public String getIdAttribute()

Return the value of the "id" attribute or null if there is not one. Equivalent to getAttributeValue(null, "id").

public int getIdAttributeResourceValue(int defaultValue)

Return the integer value of the "id" attribute or defaultValue if there is none. Equivalent to getAttributeResourceValue(null, "id", defaultValue);

public String getPositionDescription()

public int getStyleAttribute()

Return the value of the "style" attribute or 0 if there is not one. Equivalent to getAttributeResourceValue(null, "style").
Build m5-rc15i - 10 Jun 2008 13:54