|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jme.util.CloneImportExport
public class CloneImportExport
A JMEImporter and JMEExporter that stores the capsule information locally in a hash from Savable to info. This gives a local copy without any overhead of streams, zipping or setup. Found to be slightly more performant. Note: Not thread safe. Note: Ignored fields take precedence over shallow copy specification Intended usage looks something like:
CloneImportExport ie = new CloneImportExport();
ie.saveClone(node);
Node copy1 = (Node) ie.loadClone();
Node copy2 = (Node) ie.loadClone();
Node copy3 = (Node) ie.loadClone();
| Constructor Summary | |
|---|---|
CloneImportExport()
|
|
| Method Summary | |
|---|---|
void |
addIgnoredField(java.lang.String field)
Add a field to be ignored during the cloning process. |
void |
addIgnoredFields(java.util.ArrayList<java.lang.String> fields)
Add a list of fields to be ignored during the clong process. |
void |
addShadowCopyField(java.lang.String field)
Add a field to be copied by reference only, this may be useful to allow copies to shared references to certain buffers within the copies |
void |
addShallowCopyFields(java.util.ArrayList<java.lang.String> fields)
Add a list of fields to be copied by reference only, this may be useful to allow copies to shared references to certain buffers within the copies |
void |
applyConfiguration(CloneConfiguration config)
Apply a complete configuration to the cloner process |
com.jme.util.CloneImportExport.CloneCapsule |
getCapsule(Savable object)
|
Savable |
load(java.io.File f)
|
Savable |
load(java.io.InputStream f)
|
Savable |
load(java.net.URL f)
|
Savable |
loadClone()
Load the savable that is currently stored in this import/export utility. |
boolean |
save(Savable object,
java.io.File f)
|
boolean |
save(Savable object,
java.io.OutputStream f)
|
boolean |
saveClone(Savable object)
Save the specified savable into the local state to allow it to be cloned later using loadClone |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CloneImportExport()
| Method Detail |
|---|
public com.jme.util.CloneImportExport.CloneCapsule getCapsule(Savable object)
getCapsule in interface JMEExportergetCapsule in interface JMEImporterJMEExporter.getCapsule(com.jme.util.export.Savable)public void applyConfiguration(CloneConfiguration config)
config - The configuration to applypublic void addShadowCopyField(java.lang.String field)
field - The name of the field to shallow copypublic void addShallowCopyFields(java.util.ArrayList<java.lang.String> fields)
fields - The name of the fields to shallow copypublic void addIgnoredField(java.lang.String field)
field - The name of field to be ignoredpublic void addIgnoredFields(java.util.ArrayList<java.lang.String> fields)
fields - The names of the fields to be ignoredpublic boolean saveClone(Savable object)
loadClone
object - The savable which we're cloning
public boolean save(Savable object,
java.io.OutputStream f)
throws java.io.IOException
save in interface JMEExporterjava.io.IOExceptionJMEExporter.save(com.jme.util.export.Savable,
java.io.OutputStream)
public boolean save(Savable object,
java.io.File f)
throws java.io.IOException
save in interface JMEExporterjava.io.IOExceptionJMEExporter.save(com.jme.util.export.Savable,
java.io.File)public Savable loadClone()
saveClone
public Savable load(java.io.InputStream f)
throws java.io.IOException
load in interface JMEImporterjava.io.IOExceptionJMEImporter.load(java.io.InputStream)
public Savable load(java.net.URL f)
throws java.io.IOException
load in interface JMEImporterjava.io.IOExceptionJMEImporter.load(java.net.URL)
public Savable load(java.io.File f)
throws java.io.IOException
load in interface JMEImporterjava.io.IOExceptionJMEImporter.load(java.io.File)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||