sears.file
Class SubFile

java.lang.Object
  extended by sears.file.SubtitleFile
      extended by sears.file.SubFile

public class SubFile
extends SubtitleFile

Class SubFile.
Summary:
This class represents a sub subtitle file. Specialize the SubtitleFile for sub type subtitles.


Field Summary
protected static java.lang.String LINE_SEPARATOR
          the line separator in the sub subtitle text: '|'
protected static double MOVIE_FRAMERATE
          Standards framerate
protected static double NTSC_FRAMERATE
           
protected static double PAL_FRAMERATE
           
protected static java.lang.String TIME_LINE_PATTERN
          pattern that represents sub subtitle time line, a string that begin by: {number}{number}
protected static java.lang.String TIME_SEPARATOR
          The time separator, used by StrinkTokenozer object to gets back start and end time
 
Fields inherited from class sears.file.SubtitleFile
BASIC_CHARSETS, DEFAULT_CHARSET, file, fileChanged, subtitleList, temporaryFile
 
Constructor Summary
SubFile()
          Constructor SubFile.
SubFile(java.io.File file, java.util.ArrayList<Subtitle> subtitleList)
          Constructor SubFile.
SubFile(java.io.File file, java.util.ArrayList<Subtitle> subtitleList, java.lang.String charset)
           
SubFile(java.lang.String file, java.util.ArrayList<Subtitle> subtitleList)
          Constructor SubFile.
 
Method Summary
 java.lang.String extension()
          Returns the extension file
protected  SubtitleFile getNewInstance()
          Method getNewInstance.
protected  void parse()
          Method parse.
 void writeToFile(java.io.File fileToWrite)
          Method writeToFile.
 void writeToTemporaryFile()
          Method writeToTemporaryFile.
 
Methods inherited from class sears.file.SubtitleFile
accentRepair, addFakeSub, addSubtitle, addSubtitle, append, delay, delay, delay, fileChanged, getANonNullCharset, getCharset, getContentDirectory, getFile, getInstance, getInstance, getInstance, getLineSeparator, getSubtitleAtDate, getSubtitleList, getSubtitleListClone, getSubtitles, getTemporaryFile, htmlRepair, isFileChanged, magicResynchro, mixWithAnotherSubtitleFile, normalizeDuration, normalizeDuration, orderRepair, resynchro, setCharset, setFile, setSubtitleList, shiftToZero, split, stringToTime, timeRepair, timeToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

protected static final java.lang.String LINE_SEPARATOR
the line separator in the sub subtitle text: '|'

See Also:
Constant Field Values

TIME_SEPARATOR

protected static final java.lang.String TIME_SEPARATOR
The time separator, used by StrinkTokenozer object to gets back start and end time

See Also:
Constant Field Values

TIME_LINE_PATTERN

protected static final java.lang.String TIME_LINE_PATTERN
pattern that represents sub subtitle time line, a string that begin by: {number}{number}

See Also:
Constant Field Values

MOVIE_FRAMERATE

protected static final double MOVIE_FRAMERATE
Standards framerate

See Also:
Constant Field Values

PAL_FRAMERATE

protected static final double PAL_FRAMERATE
See Also:
Constant Field Values

NTSC_FRAMERATE

protected static final double NTSC_FRAMERATE
See Also:
Constant Field Values
Constructor Detail

SubFile

public SubFile()
Constructor SubFile.
Summary:
Constructor of the class. Beware not to use this file directly, because it does contains no ST. You will have to fill the list of ST, and save the File first.


SubFile

public SubFile(java.io.File file,
               java.util.ArrayList<Subtitle> subtitleList)
        throws FileConversionException
Constructor SubFile.
Summary:
Constructor of the class.

Parameters:
file - The (File) to open.
subtitleList - The (ArrayList) List of subtitles.
Throws:
FileConversionException

SubFile

public SubFile(java.lang.String file,
               java.util.ArrayList<Subtitle> subtitleList)
        throws FileConversionException
Constructor SubFile.
Summary:
Constructor of the class.

Parameters:
file - The (String) path to file to open.
subtitleList - The (ArrayList) List of subtitles.
Throws:
FileConversionException

SubFile

public SubFile(java.io.File file,
               java.util.ArrayList<Subtitle> subtitleList,
               java.lang.String charset)
        throws FileConversionException
Throws:
FileConversionException
Method Detail

extension

public java.lang.String extension()
Description copied from class: SubtitleFile
Returns the extension file

Specified by:
extension in class SubtitleFile
Returns:
the extension file

getNewInstance

protected SubtitleFile getNewInstance()
Description copied from class: SubtitleFile
Method getNewInstance.
Summary:
This method should return a new instance of the current SubtitleFile class.

Specified by:
getNewInstance in class SubtitleFile
Returns:
SubtitleFile A new instance of the current SubtitleFile class.

parse

protected void parse()
              throws FileConversionException
Description copied from class: SubtitleFile
Method parse.
Summary:
This method parse the current file, and construct the subtitleList.

Specified by:
parse in class SubtitleFile
Throws:
FileConversionException - if a limitation when reading the file appears

writeToFile

public void writeToFile(java.io.File fileToWrite)
                 throws FileConversionException
Description copied from class: SubtitleFile
Method writeToFile.
Summary:
Use this method to write subtitle file to the given File.

Specified by:
writeToFile in class SubtitleFile
Parameters:
fileToWrite - The File to write the file.
Throws:
FileConversionException

writeToTemporaryFile

public void writeToTemporaryFile()
Description copied from class: SubtitleFile
Method writeToTemporaryFile.
Summary:
Use this method to write subtitle file to the temporary File.

Specified by:
writeToTemporaryFile in class SubtitleFile