Additional top-level class in compilation unit: FetcherInfo.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| private | ImageFetcher()
We must only call the 5 args super() constructor passing in "false" to indicate to not inherit locals. |
| private | ImageFetcher(ThreadGroup threadGroup, int index)
Constructor for ImageFetcher -- only called by add() below. |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | |
| public static boolean | |
| private static void | createFetchers(final FetcherInfo info)
Create and start ImageFetcher threads in the appropriate ThreadGroup. |
| private void | |
| public static boolean | |
| private static ImageFetchable | |
| public static void | |
| public void | run()
Overrides java. Implements java. The main run() method of an ImageFetcher Thread. |
| pack-priv static void | |
| private static void | stoppingAnimation(Thread me)
Returns this image animator thread back to service as an ImageFetcher if possible. |
| ANIM_PRIORITY | back to summary |
|---|---|
| pack-priv static final int ANIM_PRIORITY | |
| HIGH_PRIORITY | back to summary |
|---|---|
| pack-priv static final int HIGH_PRIORITY | |
| LOW_PRIORITY | back to summary |
|---|---|
| pack-priv static final int LOW_PRIORITY | |
| TIMEOUT | back to summary |
|---|---|
| pack-priv static final int TIMEOUT | |
| ImageFetcher | back to summary |
|---|---|
| private ImageFetcher() We must only call the 5 args super() constructor passing in "false" to indicate to not inherit locals. | |
| ImageFetcher | back to summary |
|---|---|
| private ImageFetcher(ThreadGroup threadGroup, int index) Constructor for ImageFetcher -- only called by add() below. | |
| add | back to summary |
|---|---|
| public static boolean add(ImageFetchable src) Adds an ImageFetchable to the queue of items to fetch. Instantiates a new ImageFetcher if it's reasonable to do so. If there is no available fetcher to process an ImageFetchable, then reports failure to caller. | |
| amFetcher | back to summary |
|---|---|
| public static boolean amFetcher() Checks to see if the current thread is one of the ImageFetchers. | |
| createFetchers | back to summary |
|---|---|
| private static void createFetchers(final FetcherInfo info) Create and start ImageFetcher threads in the appropriate ThreadGroup. | |
| fetchloop | back to summary |
|---|---|
| private void fetchloop() The main ImageFetcher loop. Repeatedly calls nextImage(), and fetches the returned ImageFetchable objects until nextImage() returns null. | |
| isFetcher | back to summary |
|---|---|
| public static boolean isFetcher(Thread t) Checks to see if the given thread is one of the ImageFetchers. | |
| nextImage | back to summary |
|---|---|
| private static ImageFetchable nextImage() Returns the next ImageFetchable to be processed. If TIMEOUT elapses in the mean time, or if the ImageFetcher is interrupted, null is returned. | |
| remove | back to summary |
|---|---|
| public static void remove(ImageFetchable src) Removes an ImageFetchable from the queue of items to fetch. | |
| run | back to summary |
|---|---|
| public void run() Overrides java. Implements java. The main run() method of an ImageFetcher Thread. Calls fetchloop() to do the work, then removes itself from the array of ImageFetchers. | |
| startingAnimation | back to summary |
|---|---|
| pack-priv static void startingAnimation() Recycles this ImageFetcher thread as an image animator thread. Removes this ImageFetcher from the array of ImageFetchers, and resets the thread name to "ImageAnimator". | |
| stoppingAnimation | back to summary |
|---|---|
| private static void stoppingAnimation(Thread me) Returns this image animator thread back to service as an ImageFetcher if possible. Puts it back into the array of ImageFetchers and sets the thread name back to "Image Fetcher". If there are already the maximum number of ImageFetchers, this method simply returns, and fetchloop() will drop out when it sees that this thread isn't one of the ImageFetchers, and this thread will die. | |