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)
IMethodCollectionMethod_info descriptor at a given offset.get in interface IMethodCollectionoffset - method offset [must be in [0, size()) range; input not checked]public int[] get(ClassDef cls, java.lang.String name)
IMethodCollectionget in interface IMethodCollectioncls - 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()
IMethodCollectionsize in interface IMethodCollectionpublic java.lang.Object clone()
clone in interface IMethodCollectionclone 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 IMethodCollectionpublic int add(Method_info method)
IMethodCollectionadd in interface IMethodCollectionmethod - new method descriptor [may not be null]public Method_info set(int offset, Method_info method)
IMethodCollectionset in interface IMethodCollectionoffset - 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)
IMethodCollectionremove in interface IMethodCollectionoffset - method offset [must be in [0, size()) range; input not checked]