Methods Summary |
---|
public void | accept(IClassDefVisitor visitor, java.lang.Object ctx)
visitor.visit (this, ctx);
|
public int | add(Method_info method)
final int newoffset = m_methods.size (); // use size() if class becomes non-final
m_methods.add (method);
return newoffset;
|
public java.lang.Object | clone()Performs a deep copy.
try
{
final MethodCollection _clone = (MethodCollection) super.clone ();
// deep clone:
final int methods_count = m_methods.size (); // use size() if class becomes non-final
_clone.m_methods = new ArrayList (methods_count);
for (int m = 0; m < methods_count; ++ m)
{
_clone.m_methods.add (((Method_info) m_methods.get (m)).clone ());
}
return _clone;
}
catch (CloneNotSupportedException e)
{
throw new InternalError (e.toString ());
}
|
public Method_info | get(int offset)
return (Method_info) m_methods.get (offset);
|
public int[] | get(ClassDef cls, java.lang.String name)
if (cls == null) throw new IllegalArgumentException ("null input: cls");
// TODO: hash impl [not possible without having access to the parent ClassDef]
final int count = m_methods.size (); // use size() if class becomes non-final
final IntVector result = new IntVector (count);
for (int m = 0; m < count; ++ m)
{
final Method_info method = (Method_info) m_methods.get (m);
if (method.getName (cls).equals (name))
result.add (m);
}
return result.values (); // IntVector optimizes for the empty case
|
public Method_info | remove(int offset)
return (Method_info) m_methods.remove (offset);
|
public Method_info | set(int offset, Method_info method)
return (Method_info) m_methods.set (offset, method);
|
public int | size()
return m_methods.size ();
|
public void | writeInClassFormat(com.vladium.jcd.lib.UDataOutputStream out)
final int methods_count = m_methods.size (); // use size() if class becomes non-final
out.writeU2 (methods_count);
for (int i = 0; i < methods_count; i++)
{
get (i).writeInClassFormat (out);
}
|