FileDocCategorySizeDatePackage
IMethodCollection.javaAPI DocAndroid 1.5 API3849Wed May 06 22:41:16 BST 2009com.vladium.jcd.cls

IMethodCollection

public interface IMethodCollection implements Cloneable, com.vladium.jcd.compiler.IClassFormatOutput
An abstraction of the 'methods' component of .class format. The contents are {@link Method_info} structures corresponding to all methods directly declared by this class/interface. The order in which they appear is unspecified.
author
(C) 2001, Vlad Roubtsov

Fields Summary
Constructors Summary
Methods Summary
public voidaccept(IClassDefVisitor visitor, java.lang.Object ctx)

public intadd(Method_info method)
Adds a new Method_info descriptor to this collection. No duplicate checks are made. It is the responsibility of the caller to ensure that all data referenced in 'method' will eventually appear in the constant pool.

param
method new method descriptor [may not be null]

public java.lang.Objectclone()

public Method_infoget(int offset)
Returns {@link Method_info} descriptor at a given offset.

param
offset method offset [must be in [0, size()) range; input not checked]
return
Method_info descriptor [never null]
throws
IndexOutOfBoundsException if 'offset' is outside of valid range

public int[]get(ClassDef cls, java.lang.String name)
Returns an array of offsets for methods named 'name' (empty array if no matching fields found).

param
cls class definition providing the constant pool against which to resolve names [may not be null]
param
name method name [null or empty will result in no matches]
return
array of method offsets in no particular order [never null; could be empty]
throws
IllegalArgumentException if 'cls' is null

public Method_inforemove(int offset)
Removes the Method_info descriptor at a given offset. It is the responsibility of the caller to ensure that the class definition remains consistent after this change.

param
offset method offset [must be in [0, size()) range; input not checked]
return
method descriptor at this offset [never null]
throws
IndexOutOfBoundsException if 'offset' is outside of valid range

public Method_infoset(int offset, Method_info method)
Replaces the Method_info descriptor at a given offset. No duplicate checks are made. No method type compatibility checks are made. It is the responsibility of the caller to ensure that all data referenced in 'method' will eventually appear in the constant pool.

param
offset method offset [must be in [0, size()) range; input not checked]
param
method new method descriptor [may not be null]
return
previous method descriptor at this offset [never null]
throws
IndexOutOfBoundsException if 'offset' is outside of valid range

public intsize()
Returns the number of methods in this collection [can be 0].