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)
IAttributeCollection
get
in interface IAttributeCollection
offset
- attribute offset [must be in [0, size()) range; input not checked]public final boolean hasSynthetic()
hasSynthetic
in interface IAttributeCollection
public final boolean hasBridge()
hasBridge
in interface IAttributeCollection
public final InnerClassesAttribute_info getInnerClassesAttribute()
getInnerClassesAttribute
in interface IAttributeCollection
public final int size()
IAttributeCollection
size
in interface IAttributeCollection
public final long length()
IAttributeCollection
length
in interface IAttributeCollection
public java.lang.Object clone()
clone
in interface IAttributeCollection
clone
in class java.lang.Object
public void writeInClassFormat(UDataOutputStream out) throws java.io.IOException
writeInClassFormat
in interface IClassFormatOutput
java.io.IOException
public void accept(IClassDefVisitor visitor, java.lang.Object ctx)
accept
in interface IAttributeCollection
public int add(Attribute_info attribute)
IAttributeCollection
add
in interface IAttributeCollection
attribute
- new attribute descriptor [may not be null]public Attribute_info set(int offset, Attribute_info attribute)
IAttributeCollection
set
in interface IAttributeCollection
offset
- 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)
IAttributeCollection
remove
in interface IAttributeCollection
offset
- attribute offset [must be in [0, size()) range; input not checked]