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

InterfaceCollection

public final class InterfaceCollection extends Object implements IInterfaceCollection
author
(C) 2001, Vlad Roubtsov

Fields Summary
private com.vladium.util.IntVector
m_interfaces
Constructors Summary
InterfaceCollection(int capacity)

        m_interfaces = capacity < 0 ? new IntVector () : new IntVector (capacity);
    
Methods Summary
public voidaccept(IClassDefVisitor visitor, java.lang.Object ctx)

        visitor.visit (this, ctx);
    
public intadd(int interface_index)

        final int newoffset = m_interfaces.size (); // use size() if class becomes non-final
        m_interfaces.add (interface_index);
        
        return newoffset;
    
public java.lang.Objectclone()
Performs a deep copy.

        try
        {
            final InterfaceCollection _clone = (InterfaceCollection) super.clone ();
            
            // deep clone:
            _clone.m_interfaces = (IntVector) m_interfaces.clone ();
            
            return _clone;
        }
        catch (CloneNotSupportedException e)
        {
            throw new InternalError (e.toString ());
        }        
    
public intget(int offset)

        return m_interfaces.get (offset);
    
public intset(int offset, int interface_index)

        return m_interfaces.set (offset, interface_index);
    
public intsize()

        return m_interfaces.size ();
    
public voidwriteInClassFormat(com.vladium.jcd.lib.UDataOutputStream out)

        int _interfaces_count = m_interfaces.size (); // use size() if class becomes non-final
        out.writeU2 (_interfaces_count);
        
        for (int i = 0; i < _interfaces_count; i++)
        {
            out.writeU2 (get (i));
        }