edu.iu.iv.common.persistence.standard
Class JUNGGraphPajekPersister

java.lang.Object
  |
  +--edu.iu.iv.common.persistence.standard.JUNGGraphPajekPersister
All Implemented Interfaces:
Persister

public class JUNGGraphPajekPersister
extends java.lang.Object
implements Persister

A wrapper class for JUNG's PajekNetFile class that reads and writes Pajek .net files. This persister should only be used by users who are seeking to store very basic graphs which do not contain much attribute information. This wrapper currently does not store any edge weight information either.

Version:
0.1
Author:
Team IVC
See Also:
JUNG: Java Universal Network Graph Framework, http://jung.sourceforge.net

Constructor Summary
JUNGGraphPajekPersister()
           
 
Method Summary
 boolean canPersist(java.lang.Object model)
          Determines if this persister can persist the given data model.
 boolean canRestore(ResourceDescriptor resource)
           
 PropertyMap getPropertyMap()
          Gets a property map describing this persister and file format (if applicable).
 void persist(java.lang.Object model, ResourceDescriptor resource)
          Persists a data model to a resource such as a file or database.
 java.lang.Object restore(ResourceDescriptor resource)
          Restores a model from the specified resource.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JUNGGraphPajekPersister

public JUNGGraphPajekPersister()
Method Detail

getPropertyMap

public PropertyMap getPropertyMap()
Description copied from interface: Persister
Gets a property map describing this persister and file format (if applicable). If a persister does not wish to return a property map, it may return null. Returning a null value is highly discouraged. A persister must always provide enough information to let an application allow the user to make an informed choice.

Specified by:
getPropertyMap in interface Persister
Returns:
The property map of persister properties or null if the persister does not wish to return any map.
See Also:
Persister.getPropertyMap()

persist

public void persist(java.lang.Object model,
                    ResourceDescriptor resource)
             throws java.io.IOException,
                    PersistenceException
Description copied from interface: Persister
Persists a data model to a resource such as a file or database.

Specified by:
persist in interface Persister
Parameters:
model - The model to be persisted.
resource - The resource to persist the model to.
java.io.IOException
PersistenceException
See Also:
Persister.persist(java.lang.Object, edu.iu.iv.core.persistence.ResourceDescriptor)

restore

public java.lang.Object restore(ResourceDescriptor resource)
                         throws java.io.IOException,
                                java.lang.OutOfMemoryError,
                                PersistenceException
Description copied from interface: Persister
Restores a model from the specified resource. This method

Specified by:
restore in interface Persister
Returns:
The model to be restored from the data source.
java.io.IOException
java.lang.OutOfMemoryError
PersistenceException
See Also:
Persister.restore(edu.iu.iv.core.persistence.ResourceDescriptor)

canPersist

public boolean canPersist(java.lang.Object model)
Description copied from interface: Persister
Determines if this persister can persist the given data model.

Specified by:
canPersist in interface Persister
Parameters:
model - The model for which persistence is desired.
Returns:
true if this persister can persist this object, false otherwise.
See Also:
Persister.canPersist(java.lang.Object)

canRestore

public boolean canRestore(ResourceDescriptor resource)
Specified by:
canRestore in interface Persister
Parameters:
resource - The resource from which restoration is desired. An example of a resource is a file on disk.
Returns:
true if this persister can persist to or restore from this resource, false otherwise.
See Also:
Persister.canRestore(edu.iu.iv.core.persistence.ResourceDescriptor)