edu.cs.ai.kreator.datamodels
Class SampleCollection

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.SampleCollection
All Implemented Interfaces:
Latexable, StainedListener, java.io.Serializable, java.lang.Comparable<java.io.File>

public class SampleCollection
extends DataFile
implements Latexable

A SampleCollection object is a KReatorfile that contains example data

Author:
Sebastian Loh, BiBu
See Also:
Serialized Form

Field Summary
static java.lang.String extension
           
 
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
SampleCollection(java.io.File file)
          Constructs a SampleCollection object with a given project and file.
 
Method Summary
static java.util.List<java.lang.String> getAllSupportedFileExtensions()
           
 java.util.List<AtomExpression> getAtomExpressions()
           
 java.util.List<Constant> getConstants()
           
 LanguageFactory getLanguage()
           
 java.util.List<GeneralizedPredicate> getPredicates()
           
 void save()
          Saves the fileContent to the file system if the view was changed
 java.lang.String toLatex()
          export the sample collection file to LaTeX
 
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

extension

public static final java.lang.String extension
See Also:
Constant Field Values
Constructor Detail

SampleCollection

public SampleCollection(java.io.File file)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
Constructs a SampleCollection object with a given project and file.

Throws:
java.io.FileNotFoundException
java.io.IOException
Method Detail

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.

getLanguage

public LanguageFactory getLanguage()
                            throws ParsingException,
                                   java.io.IOException
Returns:
The language of this sample collection
Throws:
ParsingException
java.io.IOException

getAtomExpressions

public java.util.List<AtomExpression> getAtomExpressions()
                                                  throws ParsingException,
                                                         java.io.IOException
Returns:
all Atom expression of this sample collection 's language.
Throws:
ParsingException
java.io.IOException

getPredicates

public java.util.List<GeneralizedPredicate> getPredicates()
                                                   throws ParsingException,
                                                          java.io.IOException
Returns:
all predicates of this sample collection 's language.
Throws:
java.io.IOException
GroundAtomParsingException
ParsingException

getConstants

public java.util.List<Constant> getConstants()
                                      throws ParsingException,
                                             java.io.IOException
Returns:
all Constants of this sample collection 's language.
Throws:
java.io.IOException
GroundAtomParsingException
ParsingException

getAllSupportedFileExtensions

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

toLatex

public java.lang.String toLatex()
export the sample collection file to LaTeX

Specified by:
toLatex in interface Latexable
Returns:
the LaTex String or an error message of defining style