com.threerings.opengl.util
Class PreloadableSet
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<Preloadable>
com.threerings.opengl.util.PreloadableSet
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<Preloadable>, Collection<Preloadable>, Set<Preloadable>
public class PreloadableSet
- extends HashSet<Preloadable>
Contains a set of preloadables and provides a means for incrementalling preloading them.
- See Also:
- Serialized Form
|
Method Summary |
boolean |
add(Preloadable preloadable)
|
float |
preloadBatch()
Preloads a batch of the default duration. |
float |
preloadBatch(long duration)
Preloads a batch of resources in the set. |
PreloadableSet
public PreloadableSet(GlContext ctx)
- Creates a new preloadable set.
preloadBatch
public float preloadBatch()
- Preloads a batch of the default duration.
- Returns:
- the percentage of the total resources loaded, from zero to one.
preloadBatch
public float preloadBatch(long duration)
- Preloads a batch of resources in the set. Any preloadables added to the set after this
method is called for the first time will be preloaded immediately.
- Parameters:
duration - the maximum amount of time to spend on the batch.
- Returns:
- the percentage of the total resources loaded, from zero to one.
add
public boolean add(Preloadable preloadable)
- Specified by:
add in interface Collection<Preloadable>- Specified by:
add in interface Set<Preloadable>- Overrides:
add in class HashSet<Preloadable>
Copyright © 2011. All Rights Reserved.