com.md5importer.loader
Class ResourceLoader<T>

java.lang.Object
  extended by com.md5importer.loader.ResourceLoader<T>
Direct Known Subclasses:
AnimLoader, MeshLoader

public abstract class ResourceLoader<T>
extends java.lang.Object

ResourceLoader defines the abstraction of an loader unit that provides the common importing functionalities.


Field Summary
protected static com.jme.math.Quaternion base
          The base orientation value used for translating coordinate systems.
protected  java.io.StreamTokenizer reader
          The StreamTokenizer instance.
protected static int version
          The current supported versions of MD5 format.
 
Constructor Summary
protected ResourceLoader()
          Constructor of ResourceLoader.
 
Method Summary
abstract  void cleanup()
          Clean up the loader.
protected abstract  T load(java.lang.String name)
          Load the data with given name.
 T load(java.net.URL url, java.lang.String name)
          Load the resource.
protected  com.jme.math.Vector3f readVector()
          Read in a three-dimensional vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

base

protected static final com.jme.math.Quaternion base
The base orientation value used for translating coordinate systems.


version

protected static final int version
The current supported versions of MD5 format.

See Also:
Constant Field Values

reader

protected java.io.StreamTokenizer reader
The StreamTokenizer instance.

Constructor Detail

ResourceLoader

protected ResourceLoader()
Constructor of ResourceLoader.

Method Detail

load

public T load(java.net.URL url,
              java.lang.String name)
       throws java.io.IOException
Load the resource.

Parameters:
url - The URL to the file.
name - The String to set the result to.
Returns:
The T loaded data structure.
Throws:
java.io.IOException - If reading is interrupted.

load

protected abstract T load(java.lang.String name)
                   throws java.io.IOException
Load the data with given name.

Parameters:
name - The String to set the result to.
Returns:
The T loaded data structure.
Throws:
java.io.IOException - If reading is interrupted.

readVector

protected com.jme.math.Vector3f readVector()
                                    throws java.io.IOException
Read in a three-dimensional vector.

Returns:
The read in Vector3f instance.
Throws:
java.io.IOException - If errors occurred during file reading.

cleanup

public abstract void cleanup()
Clean up the loader.