com.android.sdklib.repository.local
Class LocalPkgInfo

java.lang.Object
  extended by com.android.sdklib.repository.local.LocalPkgInfo
All Implemented Interfaces:
java.lang.Comparable<LocalPkgInfo>
Direct Known Subclasses:
LocalAddonSysImgPkgInfo, LocalBuildToolPkgInfo, LocalDocPkgInfo, LocalExtraPkgInfo, LocalLLDBPkgInfo, LocalNdkPkgInfo, LocalPlatformPkgInfo, LocalPlatformToolPkgInfo, LocalSamplePkgInfo, LocalSourcePkgInfo, LocalSysImgPkgInfo, LocalToolPkgInfo

public abstract class LocalPkgInfo
extends java.lang.Object
implements java.lang.Comparable<LocalPkgInfo>

Information about a locally installed package.

Local package information is retrieved via the LocalSdk object. Clients should not need to create instances of LocalPkgInfo directly. Instead please use the LocalSdk methods to parse and retrieve packages.


Constructor Summary
protected LocalPkgInfo(LocalSdk localSdk, java.io.File localDir, java.util.Properties sourceProps)
           
 
Method Summary
 int compareTo(LocalPkgInfo o)
          Comparison is solely done based on the IPkgDesc.
 void delete()
          Deletes the files in the SDK corresponding to this package.
 boolean equals(java.lang.Object obj)
          Computes object equality to this instance based on the underlying IPkgDesc but also specific local properties such a local directory, update available and actual source properties.
abstract  IPkgDesc getDesc()
          Returns the IPkgDesc describing this package.
 java.lang.String getListDescription()
           
 java.lang.String getLoadError()
           
 java.io.File getLocalDir()
           
 LocalSdk getLocalSdk()
           
 java.util.Properties getSourceProperties()
           
 int hashCode()
          Computes a hash code specific to this instance based on the underlying IPkgDesc but also specific local properties such a local directory, and actual source properties.
 java.lang.String toString()
          String representation for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalPkgInfo

protected LocalPkgInfo(@NonNull
                       LocalSdk localSdk,
                       @NonNull
                       java.io.File localDir,
                       @NonNull
                       java.util.Properties sourceProps)
Method Detail

getLocalSdk

@NonNull
public LocalSdk getLocalSdk()

getLocalDir

@NonNull
public java.io.File getLocalDir()

getSourceProperties

@NonNull
public java.util.Properties getSourceProperties()

getLoadError

@Nullable
public java.lang.String getLoadError()

getDesc

@NonNull
public abstract IPkgDesc getDesc()
Returns the IPkgDesc describing this package.


compareTo

public int compareTo(@NonNull
                     LocalPkgInfo o)
Comparison is solely done based on the IPkgDesc.

Other local attributes (local directory, source properties) are not used in the comparison. Consequently compareTo(LocalPkgInfo) does not match equals(Object) and the hashCode() properties.

Specified by:
compareTo in interface java.lang.Comparable<LocalPkgInfo>

toString

public java.lang.String toString()
String representation for debugging purposes.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Computes a hash code specific to this instance based on the underlying IPkgDesc but also specific local properties such a local directory, and actual source properties.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Computes object equality to this instance based on the underlying IPkgDesc but also specific local properties such a local directory, update available and actual source properties. This is different from the behavior of compareTo(LocalPkgInfo) which only uses the IPkgDesc for ordering.

Overrides:
equals in class java.lang.Object

getListDescription

@NonNull
public java.lang.String getListDescription()

delete

public void delete()
Deletes the files in the SDK corresponding to this package.