public class AssetKey<T> extends java.lang.Object implements Savable, java.lang.Cloneable
AssetKey
is a key that is used to
look up a resource from a cache.
This class should be immutable.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
extension |
protected java.lang.String |
folder |
protected java.lang.String |
name |
Constructor and Description |
---|
AssetKey() |
AssetKey(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
AssetKey<T> |
clone() |
boolean |
equals(java.lang.Object other) |
java.lang.Class<? extends AssetCache> |
getCacheType() |
java.lang.String |
getExtension() |
protected static java.lang.String |
getExtension(java.lang.String name) |
java.lang.String |
getFolder() |
protected static java.lang.String |
getFolder(java.lang.String name) |
java.lang.String |
getName() |
java.lang.Class<? extends AssetProcessor> |
getProcessorType() |
int |
hashCode() |
void |
read(JmeImporter im) |
static java.lang.String |
reducePath(java.lang.String path)
Removes all relative elements of a path (A/B/../C.png and A/./C.png).
|
java.lang.String |
toString() |
void |
write(JmeExporter ex) |
protected java.lang.String name
protected transient java.lang.String folder
protected transient java.lang.String extension
protected static java.lang.String getExtension(java.lang.String name)
protected static java.lang.String getFolder(java.lang.String name)
public java.lang.String getName()
public java.lang.String getExtension()
AssetKey
's name. For example,
the name "Interface/Logo/Monkey.png" has an extension of "png".public java.lang.String getFolder()
name
is "Models/MyModel/MyModel.j3o"
then "Models/MyModel/" is returned.public java.lang.Class<? extends AssetCache> getCacheType()
SimpleAssetCache
is returned.public java.lang.Class<? extends AssetProcessor> getProcessorType()
public static java.lang.String reducePath(java.lang.String path)
path
- The path containing relative elementspublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void write(JmeExporter ex) throws java.io.IOException
public void read(JmeImporter im) throws java.io.IOException