Package gov.nasa.worldwind.util
Class TextureAtlasElement.RequestTask
- java.lang.Object
-
- gov.nasa.worldwind.util.TextureAtlasElement.RequestTask
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- TextureAtlasElement
protected static class TextureAtlasElement.RequestTask extends java.lang.Object implements java.lang.Runnable
RequestTask is an implementation of the Runnable interface who'srun
method retrieves and loads this element's image source.
-
-
Field Summary
Fields Modifier and Type Field Description protected TextureAtlasElement
elem
The texture atlas element associated with this request task.
-
Constructor Summary
Constructors Modifier Constructor Description protected
RequestTask(TextureAtlasElement elem)
Constructs a new request task with the specified texture atlas element, but otherwise does nothing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Indicates whether another request task is equivalent to this one.int
hashCode()
Returns the hash code for this request task's texture atlas element.void
run()
Retrieves and loads the image source from this request task's texture atlas element, and notifies the element when the load completes.java.lang.String
toString()
Returns the string representation of this request task's texture atlas element.
-
-
-
Field Detail
-
elem
protected TextureAtlasElement elem
The texture atlas element associated with this request task. Specified during construction.
-
-
Constructor Detail
-
RequestTask
protected RequestTask(TextureAtlasElement elem)
Constructs a new request task with the specified texture atlas element, but otherwise does nothing. Calling the new request tasksrun
method causes this to retrieve and load the specified element's image source.- Parameters:
elem
- the texture atlas element who's image source is retrieved and loaded.- Throws:
java.lang.IllegalArgumentException
- if the element isnull
.
-
-
Method Detail
-
run
public void run()
Retrieves and loads the image source from this request task's texture atlas element, and notifies the element when the load completes. This does nothing if the current thread has been interrupted.- Specified by:
run
in interfacejava.lang.Runnable
-
equals
public boolean equals(java.lang.Object o)
Indicates whether another request task is equivalent to this one. This tests equality using the texture atlas element source of each task.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- the object to test.- Returns:
true
if the specified object is a RequestTask, and its texture atlas element is equivalent to this task's texture atlas element.
-
hashCode
public int hashCode()
Returns the hash code for this request task's texture atlas element.- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Returns the string representation of this request task's texture atlas element.- Overrides:
toString
in classjava.lang.Object
-
-