com.model.md5.importer.resource
Class ResourceImporter<T>

java.lang.Object
  extended by com.model.md5.importer.resource.ResourceImporter<T>
Direct Known Subclasses:
AnimImporter, MeshImporter

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

ResourceImporter defines the abstraction of an importer 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 ResourceImporter()
          Constructor of ResourceImporter.
 
Method Summary
abstract  void cleanup()
          Clean up the importer.
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

ResourceImporter

protected ResourceImporter()
Constructor of ResourceImporter.

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 - Thrown when errors occurred during file reading.

cleanup

public abstract void cleanup()
Clean up the importer.