Package com.jme3.asset
Class AssetKey<T>
java.lang.Object
com.jme3.asset.AssetKey<T>
- Direct Known Subclasses:
AudioKey
,FilterKey
,MaterialKey
,ModelKey
,OgreMaterialKey
,ShaderAssetKey
,ShaderNodeDefinitionKey
,TextureKey
AssetKey
is a key that is used to
look up a resource from a cache.
This class should be immutable.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
Class<? extends AssetCache>
protected static String
getExtension
(String name) protected static String
getName()
Class<? extends AssetProcessor>
int
hashCode()
void
read
(JmeImporter im) static String
reducePath
(String path) Removes all relative elements of a path (A/B/../C.png and A/./C.png).toString()
void
write
(JmeExporter ex)
-
Field Details
-
name
-
folder
-
extension
-
-
Constructor Details
-
AssetKey
-
AssetKey
public AssetKey()
-
-
Method Details
-
clone
-
getExtension
-
getFolder
-
getName
- Returns:
- The asset path
-
getExtension
- Returns:
- The extension of the
AssetKey
's name. For example, the name "Interface/Logo/Monkey.png" has an extension of "png".
-
getFolder
- Returns:
- The folder in which the asset is located in.
E.g. if the
name
is "Models/MyModel/MyModel.j3o" then "Models/MyModel/" is returned.
-
getCacheType
- Returns:
- The preferred cache class for this asset type. Specify "null"
if caching is to be disabled. By default, the
SimpleAssetCache
is returned.
-
getProcessorType
- Returns:
- The preferred processor type for this asset type. Specify "null" if no processing is required.
-
reducePath
Removes all relative elements of a path (A/B/../C.png and A/./C.png).- Parameters:
path
- The path containing relative elements- Returns:
- A path without relative elements
-
equals
-
hashCode
public int hashCode() -
toString
-
write
- Specified by:
write
in interfaceSavable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Throws:
IOException
-