edu.cs.ai.kreator.datamodels
Class KnowledgebaseFile

java.lang.Object
  extended by java.io.File
      extended by edu.cs.ai.kreator.datamodels.AbstractKreatorFile
          extended by edu.cs.ai.kreator.datamodels.DataFile
              extended by edu.cs.ai.kreator.datamodels.KnowledgebaseFile
All Implemented Interfaces:
Latexable, StainedListener, java.io.Serializable, java.lang.Comparable<java.io.File>

public class KnowledgebaseFile
extends DataFile
implements Latexable

Author:
Sebastian Loh, Matthias Thimm
See Also:
Serialized Form

Field Summary
protected  Knowledgebase model
          Stores the model of this knowledgebase.
 
Fields inherited from class edu.cs.ai.kreator.datamodels.AbstractKreatorFile
fileContent, LOG
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
KnowledgebaseFile(java.io.File file)
          Default Constructor. creates a Knowledgebase as a DataFile with the given file
 
Method Summary
static java.util.List<java.lang.String> getAllSupportedFileExtensions()
          Returns all file extensions, which KnowledgebaseFiles can have.
 Knowledgebase getModel()
          Get the model of this file, ie a knowledgebase.
protected  void initKnowledgebase()
          This method intializes the locally stored model described by this file.
 void save()
          Saves the fileContent to the file system if the view was changed
 java.lang.String toLatex()
          Returns a Latex grammar conform string to generate variables, rules (conditionals) etc.
 
Methods inherited from class edu.cs.ai.kreator.datamodels.DataFile
load
 
Methods inherited from class edu.cs.ai.kreator.datamodels.AbstractKreatorFile
addKReatorFileListener, fireModelChanged, getFileContent, removeKReatorFileListener, setFileContent, stainedStatusChanged, viewsAreStained
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

model

protected Knowledgebase model
Stores the model of this knowledgebase. Is null until first needed.

Constructor Detail

KnowledgebaseFile

public KnowledgebaseFile(java.io.File file)
                  throws java.io.FileNotFoundException,
                         java.io.IOException
Default Constructor. creates a Knowledgebase as a DataFile with the given file

Parameters:
file -
Throws:
java.io.FileNotFoundException
java.io.IOException
Method Detail

getAllSupportedFileExtensions

public static java.util.List<java.lang.String> getAllSupportedFileExtensions()
Returns all file extensions, which KnowledgebaseFiles can have.

Returns:
all file extensions, which KnowledgebaseFiles can have.

getModel

public Knowledgebase getModel()
                       throws java.io.IOException,
                              ParsingException
Get the model of this file, ie a knowledgebase.

Returns:
a knowledgebase or null if it could not be initialized.
Throws:
java.io.IOException
ParsingException

initKnowledgebase

protected void initKnowledgebase()
                          throws java.io.IOException,
                                 ParsingException
This method intializes the locally stored model described by this file.

Throws:
java.io.IOException
ParsingException

save

public void save()
          throws java.io.IOException
Description copied from class: DataFile
Saves the fileContent to the file system if the view was changed

Overrides:
save in class DataFile
Throws:
java.io.IOException - if the file could not write on the file system.

toLatex

public java.lang.String toLatex()
Description copied from interface: Latexable
Returns a Latex grammar conform string to generate variables, rules (conditionals) etc.

Specified by:
toLatex in interface Latexable
Returns:
a Latex grammar conform string.