sears.file
Class SrtFile

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

public class SrtFile
extends SubtitleFile

Class SrtFile.
Summary:
This class represent a srt subtitle file. Specialize the SubtitleFile for srt type subtitles.


Field Summary
 
Fields inherited from class sears.file.SubtitleFile
END_OF_LINE, file, fileChanged, subtitleList, temporaryFile
 
Constructor Summary
SrtFile()
          Constructor SrtFile.
SrtFile(java.io.File file, java.util.ArrayList<Subtitle> subtitleList)
          Constructor SrtFile.
SrtFile(java.lang.String file, java.util.ArrayList<Subtitle> subtitleList)
          Constructor SrtFile.
 
Method Summary
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, getContentDirectory, getFile, getSubtitleAtDate, getSubtitles, getTemporaryFile, htmlRepair, isFileChanged, magicResynchro, normalizeDuration, normalizeDuration, orderRepair, resynchro, setFile, shiftToZero, split, stringToTime, timeRepair, timeToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SrtFile

public SrtFile()
Constructor SrtFile.
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.


SrtFile

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

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

SrtFile

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

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

parse

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

Specified by:
parse in class SubtitleFile

writeToFile

public void writeToFile(java.io.File fileToWrite)
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.

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

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.