final class AttributeCollection extends java.lang.Object implements IAttributeCollection
| Modifier and Type | Field and Description |
|---|---|
private static boolean |
DISALLOW_MULTIPLE_SYNTHETIC_ATTRIBUTES |
private java.util.List |
m_attributes |
private int |
m_bridgeRefCount |
private int |
m_innerClassesAttributeOffset |
private int |
m_syntheticRefCount |
| Constructor and Description |
|---|
AttributeCollection(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(IClassDefVisitor visitor,
java.lang.Object ctx) |
int |
add(Attribute_info attribute)
Adds a new Attribute_info descriptor to this collection.
|
java.lang.Object |
clone()
Performs a deep copy.
|
Attribute_info |
get(int offset)
Returns the attribute descriptor at a given offset.
|
InnerClassesAttribute_info |
getInnerClassesAttribute() |
boolean |
hasBridge() |
boolean |
hasSynthetic() |
long |
length()
Returns the total length of this collection when converted to
.class format [including 2 count bytes]
|
Attribute_info |
remove(int offset)
Removes the Attribute_info descriptor at a given offset.
|
Attribute_info |
set(int offset,
Attribute_info attribute)
Replaces the Attribute_info descriptor at a given offset.
|
int |
size()
Returns the number of attributes in this collection [can be 0].
|
void |
writeInClassFormat(UDataOutputStream out) |
private java.util.List m_attributes
private transient int m_syntheticRefCount
private transient int m_bridgeRefCount
private transient int m_innerClassesAttributeOffset
private static final boolean DISALLOW_MULTIPLE_SYNTHETIC_ATTRIBUTES
public final Attribute_info get(int offset)
IAttributeCollectionget in interface IAttributeCollectionoffset - attribute offset [must be in [0, size()) range; input not checked]public final boolean hasSynthetic()
hasSynthetic in interface IAttributeCollectionpublic final boolean hasBridge()
hasBridge in interface IAttributeCollectionpublic final InnerClassesAttribute_info getInnerClassesAttribute()
getInnerClassesAttribute in interface IAttributeCollectionpublic final int size()
IAttributeCollectionsize in interface IAttributeCollectionpublic final long length()
IAttributeCollectionlength in interface IAttributeCollectionpublic java.lang.Object clone()
clone in interface IAttributeCollectionclone in class java.lang.Objectpublic void writeInClassFormat(UDataOutputStream out) throws java.io.IOException
writeInClassFormat in interface IClassFormatOutputjava.io.IOExceptionpublic void accept(IClassDefVisitor visitor, java.lang.Object ctx)
accept in interface IAttributeCollectionpublic int add(Attribute_info attribute)
IAttributeCollectionadd in interface IAttributeCollectionattribute - new attribute descriptor [may not be null]public Attribute_info set(int offset, Attribute_info attribute)
IAttributeCollectionset in interface IAttributeCollectionoffset - attribute offset [must be in [0, size()) range; input not checked]attribute - new attribute descriptor [may not be null]public Attribute_info remove(int offset)
IAttributeCollectionremove in interface IAttributeCollectionoffset - attribute offset [must be in [0, size()) range; input not checked]