|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.sdklib.internal.repository.sources.SdkSources
public class SdkSources
A list of sdk-repository and sdk-addon sources, sorted by SdkSourceCategory.
| Constructor Summary | |
|---|---|
SdkSources()
|
|
| Method Summary | |
|---|---|
void |
add(SdkSourceCategory category,
SdkSource source)
Adds a new source to the Sources list. |
void |
addChangeListener(java.lang.Runnable changeListener)
Adds a listener that will be notified when the sources list has changed. |
void |
clearAllPackages()
Each source keeps a local cache of whatever it loaded recently. |
SdkSource[] |
getAllSources()
Returns an array of the sources across all categories. |
SdkSourceCategory[] |
getCategories()
Returns a set of all categories that must be displayed. |
SdkSourceCategory |
getCategory(SdkSource source)
Returns the category of a given source, or null if the source is unknown. |
SdkSource[] |
getSources(SdkSourceCategory category)
Returns a new array of sources attached to the given category. |
boolean |
hasSourceUrl(SdkSource source)
Returns true if there's already a similar source in the sources list under any category. |
boolean |
hasSourceUrl(SdkSourceCategory category,
SdkSource source)
Returns true if there's already a similar source in the sources list under the specified category. |
void |
loadUserAddons(com.android.utils.ILogger log)
Loads all user sources. |
void |
notifyChangeListeners()
Invoke all the registered change listeners, if any. |
void |
remove(SdkSource source)
Removes a source from the Sources list. |
void |
removeAll(SdkSourceCategory category)
Removes all the sources in the given category. |
void |
removeChangeListener(java.lang.Runnable changeListener)
Removes a listener from the list of listeners to notify when the sources change. |
void |
saveUserAddons(com.android.utils.ILogger log)
Saves all the user sources. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SdkSources()
| Method Detail |
|---|
public void add(SdkSourceCategory category,
SdkSource source)
SdkSources doesn't invoke notifyChangeListeners()
directly. Callers who use add() are responsible for notifying the listeners once
they are done modifying the sources list. The intent is to notify the listeners only once
at the end, not for every single addition.
public void remove(SdkSource source)
notifyChangeListeners() once they are done modifying the sources list.
public void removeAll(SdkSourceCategory category)
notifyChangeListeners() once they are done modifying the sources list.
public SdkSourceCategory[] getCategories()
public SdkSource[] getSources(SdkSourceCategory category)
public SdkSource[] getAllSources()
public void clearAllPackages()
SdkSource.clearPackages() on all the available sources,
and the next call to SdkSource.getPackages() will actually reload
the remote package list.
public SdkSourceCategory getCategory(SdkSource source)
hasSourceUrl(SdkSource) does.
The search is O(N), which should be acceptable on the expectedly small source list.
public boolean hasSourceUrl(SdkSource source)
SdkSource.equals(Object) which compares the source URLs.
The search is O(N), which should be acceptable on the expectedly small source list.
public boolean hasSourceUrl(SdkSourceCategory category,
SdkSource source)
SdkSource.equals(Object) which compares the source URLs.
The search is O(N), which should be acceptable on the expectedly small source list.
public void loadUserAddons(com.android.utils.ILogger log)
notifyChangeListeners() at the end of the operation.
public void saveUserAddons(com.android.utils.ILogger log)
log - Logger. Cannot be null.public void addChangeListener(java.lang.Runnable changeListener)
changeListener - A non-null listener to add. Ignored if already present.notifyChangeListeners()public void removeChangeListener(java.lang.Runnable changeListener)
changeListener - A listener to remove. Ignored if not previously added.public void notifyChangeListeners()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||