maito.browsing.fileexport
Class PajekFormat

java.lang.Object
  extended by maito.browsing.fileexport.PajekFormat
All Implemented Interfaces:
FileFormat

public class PajekFormat
extends java.lang.Object
implements FileFormat

A FileFormat implementation for simple Pajek .net graphs Uses the Resource IDs as the names in the Vertex list.

Author:
Väinö Ala-Härkönen

Constructor Summary
PajekFormat()
           
 
Method Summary
 void setRelations(ResourceRelation[] relations)
          Sets the relations that are to be written to the file.
 void setResources(Resource[] resources)
          Sets the resources that are to be written to the file.
 boolean writeFile(java.lang.String fileName)
          Writes the data set by setResources and setRelations to a file that's in Pajek .net format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PajekFormat

public PajekFormat()
Method Detail

setResources

public void setResources(Resource[] resources)
Sets the resources that are to be written to the file.

Specified by:
setResources in interface FileFormat
Parameters:
resources - The resources that are to be written to the file. The possible previous set will be replaced.

setRelations

public void setRelations(ResourceRelation[] relations)
Sets the relations that are to be written to the file. Relations that contain resources which aren't in the resource array (set by setResources) won't be written to the file

Specified by:
setRelations in interface FileFormat
Parameters:
relations - The relations that are to be written to the file. The possible previous set will be replaced.

writeFile

public boolean writeFile(java.lang.String fileName)
Writes the data set by setResources and setRelations to a file that's in Pajek .net format.

Specified by:
writeFile in interface FileFormat
Parameters:
filename - the full path and name of the file to write the data to
Returns:
true if succeeded, false if there was an error: either the file could not be written or source data was invalid.