com.threerings.opengl.util
Class PreloadableSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<Preloadable>
              extended by 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

Constructor Summary
PreloadableSet(GlContext ctx)
          Creates a new preloadable set.
 
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.
 
Methods inherited from class java.util.HashSet
clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

PreloadableSet

public PreloadableSet(GlContext ctx)
Creates a new preloadable set.

Method Detail

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.