gr.demokritos.iit.jinsect.spock.console
Class FileFormat

java.lang.Object
  extended by gr.demokritos.iit.jinsect.spock.console.FileFormat
All Implemented Interfaces:
IDocumentSet

public class FileFormat
extends java.lang.Object
implements IDocumentSet

This class deals with the formating of the file that represents the clusters in the spock challenge. The class provides methods for parsing such files and also creating such files.


Constructor Summary
FileFormat()
          Constructor method: Creates a new instance of FileFormat
 
Method Summary
 void createFile(java.lang.String fileName)
          Create a file according to the spock-challenge format using the data structure that contains the clusters.
 void createSets()
           
 java.util.List getCategories()
           
 java.util.Hashtable getClusters()
          Get the clusters data structure
 java.util.ArrayList getFilesFromCategory(java.lang.String sCategoryName)
           
 int getNumberOfClusters()
          Get the number of clusters
 java.util.ArrayList getTestSet()
           
 java.util.ArrayList getTrainingSet()
           
 void parseFile(java.lang.String fileName)
          Parse the file specified by the fileFormat string and store the necessary info to the data structures of this class.
 void setClusters(java.util.Hashtable clusterHash)
          Set the cluster data structure
 void setNumberOfClusters(int numOfClusters)
          Set the number of clusters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFormat

public FileFormat()
Constructor method: Creates a new instance of FileFormat

Method Detail

parseFile

public void parseFile(java.lang.String fileName)
Parse the file specified by the fileFormat string and store the necessary info to the data structures of this class.

Parameters:
fileName - the file to parse

createFile

public void createFile(java.lang.String fileName)
Create a file according to the spock-challenge format using the data structure that contains the clusters.

Parameters:
fileName - the file to create

getNumberOfClusters

public int getNumberOfClusters()
Get the number of clusters

Returns:
number of clusters

getClusters

public java.util.Hashtable getClusters()
Get the clusters data structure

Returns:
the Hashtable that contains the clusters

setNumberOfClusters

public void setNumberOfClusters(int numOfClusters)
Set the number of clusters

Parameters:
numOfClusters - the number of clusters

setClusters

public void setClusters(java.util.Hashtable clusterHash)
Set the cluster data structure

Parameters:
clusterHash - the Hashtable that contains the clusters

getCategories

public java.util.List getCategories()
Specified by:
getCategories in interface IDocumentSet

createSets

public void createSets()
Specified by:
createSets in interface IDocumentSet

getFilesFromCategory

public java.util.ArrayList getFilesFromCategory(java.lang.String sCategoryName)
Specified by:
getFilesFromCategory in interface IDocumentSet

getTrainingSet

public java.util.ArrayList getTrainingSet()
Specified by:
getTrainingSet in interface IDocumentSet

getTestSet

public java.util.ArrayList getTestSet()
Specified by:
getTestSet in interface IDocumentSet