final class MethodCollection extends java.lang.Object implements IMethodCollection
Modifier and Type | Field and Description |
---|---|
private java.util.List |
m_methods |
Constructor and Description |
---|
MethodCollection(int capacity) |
Modifier and Type | Method and Description |
---|---|
void |
accept(IClassDefVisitor visitor,
java.lang.Object ctx) |
int |
add(Method_info method)
Adds a new Method_info descriptor to this collection.
|
java.lang.Object |
clone()
Performs a deep copy.
|
int[] |
get(ClassDef cls,
java.lang.String name)
Returns an array of offsets for methods named 'name' (empty array if no
matching fields found).
|
Method_info |
get(int offset)
Returns
Method_info descriptor at a given offset. |
Method_info |
remove(int offset)
Removes the Method_info descriptor at a given offset.
|
Method_info |
set(int offset,
Method_info method)
Replaces the Method_info descriptor at a given offset.
|
int |
size()
Returns the number of methods in this collection [can be 0].
|
void |
writeInClassFormat(UDataOutputStream out) |
public Method_info get(int offset)
IMethodCollection
Method_info
descriptor at a given offset.get
in interface IMethodCollection
offset
- method offset [must be in [0, size()) range; input not checked]public int[] get(ClassDef cls, java.lang.String name)
IMethodCollection
get
in interface IMethodCollection
cls
- class definition providing the constant pool against which to
resolve names [may not be null]name
- method name [null or empty will result in no matches]public int size()
IMethodCollection
size
in interface IMethodCollection
public java.lang.Object clone()
clone
in interface IMethodCollection
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 IMethodCollection
public int add(Method_info method)
IMethodCollection
add
in interface IMethodCollection
method
- new method descriptor [may not be null]public Method_info set(int offset, Method_info method)
IMethodCollection
set
in interface IMethodCollection
offset
- method offset [must be in [0, size()) range; input not checked]method
- new method descriptor [may not be null]public Method_info remove(int offset)
IMethodCollection
remove
in interface IMethodCollection
offset
- method offset [must be in [0, size()) range; input not checked]