Xj3D VRML/X3D Code API

org.web3d.vrml.nodes.loader
Class ContentLoadQueue

java.lang.Object
  extended byorg.web3d.vrml.nodes.loader.ContentLoadQueue

public class ContentLoadQueue
extends java.lang.Object

Customised queue implementation specifically designed to handle the needs of X3D/VRML external content loading by compressing multi requests for the same URL into a single structure.

Version:
$Revision: 1.4 $
Author:
Justin Couch

Method Summary
 void add(java.lang.String[] url, org.web3d.vrml.nodes.loader.FileCache cache, org.web3d.vrml.nodes.loader.LoadDetails details)
          Add the given load request onto the queue.
 void clear()
          Clear the queue of items.
 org.web3d.vrml.nodes.loader.LoadRequest getNext()
          Get the next item from the queue.
 void purge()
          Remove all elements from queue.
 void remove(java.lang.String[] url, org.web3d.vrml.nodes.loader.LoadDetails details)
          Remove the given item from the queue.
 int size()
          Return the size of the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public void add(java.lang.String[] url,
                org.web3d.vrml.nodes.loader.FileCache cache,
                org.web3d.vrml.nodes.loader.LoadDetails details)
Add the given load request onto the queue. The cache instance is only used when this is a new item being inserted into the queue.

Parameters:
url - The urls of the item to load
cache - The reference to the shared cache to check
details - Detail set for what should be loaded

getNext

public org.web3d.vrml.nodes.loader.LoadRequest getNext()
Get the next item from the queue. Block until an item is available.

Returns:
The next item on the queue

size

public int size()
Return the size of the queue.

Returns:
size of queue.

purge

public void purge()
Remove all elements from queue. Also unblock those who are waiting for items in the queue. They leave the getNext() method with null.


clear

public void clear()
Clear the queue of items. If there are users of the class that are blocked while waiting for elements in the queue, they remain so.


remove

public void remove(java.lang.String[] url,
                   org.web3d.vrml.nodes.loader.LoadDetails details)
Remove the given item from the queue.

Parameters:
url - The url of the object to be removed
details - The instance of the detail to be removed from the URL

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium