Methods Summary |
---|
public int | compareTo(IAndroidTarget target)
if (target.isPlatform()) {
return +1;
}
// vendor
int value = mVendor.compareTo(target.getVendor());
// name
if (value == 0) {
value = mName.compareTo(target.getName());
}
// api version
if (value == 0) {
value = getApiVersionNumber() - target.getApiVersionNumber();
}
return value;
|
public boolean | equals(java.lang.Object obj)
if (obj instanceof AddOnTarget) {
AddOnTarget addon = (AddOnTarget)obj;
return mVendor.equals(addon.mVendor) && mName.equals(addon.mName) &&
mBasePlatform.getApiVersionNumber() == addon.mBasePlatform.getApiVersionNumber();
}
return super.equals(obj);
|
public java.lang.String | getApiVersionName()
// this is always defined by the base platform
return mBasePlatform.getApiVersionName();
|
public int | getApiVersionNumber()
// this is always defined by the base platform
return mBasePlatform.getApiVersionNumber();
|
public java.lang.String | getClasspathName()
return String.format("%1$s [%2$s]", mName, mBasePlatform.getName());
|
public java.lang.String | getDefaultSkin()
return mDefaultSkin;
|
public java.lang.String | getDescription()
return mDescription;
|
public java.lang.String | getFullName()
return String.format("%1$s (%2$s)", mName, mVendor);
|
public java.lang.String | getLocation()
return mLocation;
|
public java.lang.String | getName()
return mName;
|
public IOptionalLibrary[] | getOptionalLibraries()
return mLibraries;
|
public IAndroidTarget | getParent()
return mBasePlatform;
|
public java.lang.String | getPath(int pathId)
switch (pathId) {
case IMAGES:
return mLocation + SdkConstants.OS_IMAGES_FOLDER;
case SKINS:
return mLocation + SdkConstants.OS_SKINS_FOLDER;
case DOCS:
return mLocation + SdkConstants.FD_DOCS + File.separator
+ SdkConstants.FD_DOCS_REFERENCE;
case SAMPLES:
// only return the add-on samples folder if there is actually a sample (or more)
File sampleLoc = new File(mLocation, SdkConstants.FD_SAMPLES);
if (sampleLoc.isDirectory()) {
File[] files = sampleLoc.listFiles(new FileFilter() {
public boolean accept(File pathname) {
return pathname.isDirectory();
}
});
if (files != null && files.length > 0) {
return sampleLoc.getAbsolutePath();
}
}
// INTENT FALL-THROUGH
default :
return mBasePlatform.getPath(pathId);
}
|
public java.lang.String[] | getSkins()
return mSkins;
|
public java.lang.String | getVendor()
return mVendor;
|
public int | hashCode()
return hashString().hashCode();
|
public java.lang.String | hashString()
return String.format(ADD_ON_FORMAT, mVendor, mName, mBasePlatform.getApiVersionNumber());
|
public boolean | isCompatibleBaseFor(IAndroidTarget target)
// basic test
if (target == this) {
return true;
}
// if the receiver has no optional library, then anything with api version number >= to
// the receiver is compatible.
if (mLibraries.length == 0) {
return target.getApiVersionNumber() >= getApiVersionNumber();
}
// Otherwise, target is only compatible if the vendor and name are equals with the api
// number greater or equal (ie target is a newer version of this add-on).
if (target.isPlatform() == false) {
return (mVendor.equals(target.getVendor()) && mName.equals(target.getName()) &&
target.getApiVersionNumber() >= getApiVersionNumber());
}
return false;
|
public boolean | isPlatform()
return false;
|
public void | setSkins(java.lang.String[] skins, java.lang.String defaultSkin)
mDefaultSkin = defaultSkin;
// we mix the add-on and base platform skins
HashSet<String> skinSet = new HashSet<String>();
skinSet.addAll(Arrays.asList(skins));
skinSet.addAll(Arrays.asList(mBasePlatform.getSkins()));
mSkins = skinSet.toArray(new String[skinSet.size()]);
|