![JAR search and dependency download from the Maven repository](/logo.png)
com.github.dnbn.submerge.api.subtitle.srt.SRTSub Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of submerge-api Show documentation
Show all versions of submerge-api Show documentation
Library to manage SRT and ASS subtitles
The newest version!
package com.github.dnbn.submerge.api.subtitle.srt;
import java.util.Set;
import java.util.TreeSet;
import com.github.dnbn.submerge.api.subtitle.common.TimedLine;
import com.github.dnbn.submerge.api.subtitle.common.TimedTextFile;
/**
* Class represents an SRT file, meandin a complete set of subtitle lines
*
*/
public class SRTSub implements TimedTextFile {
private static final long serialVersionUID = -2909833999376537734L;
private String fileName;
private Set lines = new TreeSet<>();
// ======================== Public methods ==========================
public void add(SRTLine line) {
this.lines.add(line);
}
public void remove(TimedLine line) {
this.lines.remove(line);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
this.lines.forEach(srtLine -> sb.append(srtLine));
return sb.toString();
}
// ===================== getter and setter start =====================
public Set getLines() {
return this.lines;
}
@Override
public Set extends TimedLine> getTimedLines() {
return this.lines;
}
public void setLines(Set lines) {
this.lines = lines;
}
@Override
public String getFileName() {
return this.fileName;
}
@Override
public void setFileName(String fileName) {
this.fileName = fileName;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy