com.android.sdklib.repositoryv2.targets
Class AndroidTargetManager

java.lang.Object
  extended by com.android.sdklib.repositoryv2.targets.AndroidTargetManager

public class AndroidTargetManager
extends java.lang.Object

Finds and allows access to all IAndroidTargets in a given SDK, either using the old LocalSdk mechanism or the new AndroidSdkHandler.


Constructor Summary
AndroidTargetManager(AndroidSdkHandler handler, com.android.repository.io.FileOp fop)
          Create a manager using the new AndroidSdkHandler/RepoManager mechanism for finding packages.
AndroidTargetManager(LocalSdk sdk)
          Create a manager using the old LocalSdk mechanism for finding packages.
 
Method Summary
 IAndroidTarget getTargetFromHashString(java.lang.String hash, com.android.repository.api.ProgressIndicator progress)
          Returns a target from a hash that was generated by IAndroidTarget.hashString().
 java.util.Collection<IAndroidTarget> getTargets(boolean includeMissing, com.android.repository.api.ProgressIndicator progress)
          Returns the targets (possibly including pseudo-targets containing system images with no associated target) that are available in the SDK.
 java.util.Collection<IAndroidTarget> getTargets(com.android.repository.api.ProgressIndicator progress)
          Returns the targets (platforms & addons) that are available in the SDK.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndroidTargetManager

public AndroidTargetManager(@NonNull
                            LocalSdk sdk)
Create a manager using the old LocalSdk mechanism for finding packages.


AndroidTargetManager

public AndroidTargetManager(@NonNull
                            AndroidSdkHandler handler,
                            @NonNull
                            com.android.repository.io.FileOp fop)
Create a manager using the new AndroidSdkHandler/RepoManager mechanism for finding packages.

Method Detail

getTargets

public java.util.Collection<IAndroidTarget> getTargets(com.android.repository.api.ProgressIndicator progress)
Returns the targets (platforms & addons) that are available in the SDK.


getTargets

@NonNull
public java.util.Collection<IAndroidTarget> getTargets(boolean includeMissing,
                                                               @NonNull
                                                               com.android.repository.api.ProgressIndicator progress)
Returns the targets (possibly including pseudo-targets containing system images with no associated target) that are available in the SDK.


getTargetFromHashString

@Nullable
public IAndroidTarget getTargetFromHashString(@Nullable
                                                       java.lang.String hash,
                                                       @NonNull
                                                       com.android.repository.api.ProgressIndicator progress)
Returns a target from a hash that was generated by IAndroidTarget.hashString().

Parameters:
hash - the IAndroidTarget hash string.
Returns:
The matching IAndroidTarget or null.