Class StdAttributeList
java.lang.Object
com.android.dx.util.MutabilityControl
com.android.dx.util.FixedSizeList
com.android.dx.cf.iface.StdAttributeList
- All Implemented Interfaces:
AttributeList, ToHuman
Standard implementation of
AttributeList, which directly stores
an array of Attribute objects and can be made immutable.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the total length of this list in bytes, when part of a class file.Get the first attribute in the list with the given name, if any.Get the next attribute in the list after the given one, with the same name, if any.get(int n) Get thenth attribute.voidSets the attribute at the given index.Methods inherited from class FixedSizeList
equals, get0, getOrNull0, hashCode, set0, shrinkToFit, size, toHuman, toHuman, toString, toStringMethods inherited from class MutabilityControl
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutableMethods inherited from interface AttributeList
isMutable, size
-
Constructor Details
-
StdAttributeList
public StdAttributeList(int size) Constructs an instance. All indices initially containnull.- Parameters:
size- the size of the list
-
-
Method Details
-
get
Get thenth attribute.- Specified by:
getin interfaceAttributeList- Parameters:
n-n >= 0, n < size();which attribute- Returns:
non-null;the attribute in question
-
byteLength
public int byteLength()Get the total length of this list in bytes, when part of a class file. The returned value includes the two bytes for theattributes_countlength indicator.- Specified by:
byteLengthin interfaceAttributeList- Returns:
>= 2;the total length, in bytes
-
findFirst
Get the first attribute in the list with the given name, if any.- Specified by:
findFirstin interfaceAttributeList- Parameters:
name-non-null;attribute name- Returns:
null-ok;first attribute in the list with the given name, ornullif there is none
-
findNext
Get the next attribute in the list after the given one, with the same name, if any.- Specified by:
findNextin interfaceAttributeList- Parameters:
attrib-non-null;attribute to start looking after- Returns:
null-ok;next attribute afterattribwith the same name asattrib
-
set
Sets the attribute at the given index.- Parameters:
n->= 0, < size();which attributeattribute-null-ok;the attribute object
-