FileDocCategorySizeDatePackage
PackageInfo.javaAPI DocAndroid 1.5 API2456Wed May 06 22:41:00 BST 2009com.android.apicheck

PackageInfo

public class PackageInfo extends Object

Fields Summary
private String
mName
private HashMap
mClasses
private boolean
mExistsInBoth
private SourcePositionInfo
mPosition
Constructors Summary
public PackageInfo(String name, SourcePositionInfo position)

        mName = name;
        mClasses = new HashMap<String, ClassInfo>();
        mExistsInBoth = false;
        mPosition = position;
    
Methods Summary
public voidaddClass(ClassInfo cl)

        mClasses.put(cl.name() , cl);
    
public java.util.HashMapallClasses()

        return mClasses;
    
public booleanisConsistent(com.android.apicheck.PackageInfo pInfo)

        mExistsInBoth = true;
        pInfo.mExistsInBoth = true;
        boolean consistent = true;
        for (ClassInfo cInfo : mClasses.values()) {
            if (pInfo.mClasses.containsKey(cInfo.name())) {
                if (!cInfo.isConsistent(pInfo.mClasses.get(cInfo.name()))) {
                    consistent = false;
                }
            } else {
                Errors.error(Errors.REMOVED_CLASS, cInfo.position(),
                        "Removed public class " + cInfo.qualifiedName());
                consistent = false;
            }
        }
        for (ClassInfo cInfo : pInfo.mClasses.values()) {
            if (!cInfo.isInBoth()) {
                Errors.error(Errors.ADDED_CLASS, cInfo.position(),
                        "Added class " + cInfo.name() + " to package "
                        + pInfo.name());
                consistent = false;
            }
        }
        return consistent;
    
public booleanisInBoth()

        return mExistsInBoth;
    
public java.lang.Stringname()

        return mName;
    
public SourcePositionInfoposition()

        return mPosition;