Skip to content

Commit

Permalink
Merge pull request #12 from ceefour/patch-tostring
Browse files Browse the repository at this point in the history
toString() helpers for easier logging
  • Loading branch information
JDaren committed Mar 2, 2015
2 parents 8ea003c + 36f251e commit 26f3a0d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/main/java/subtitleFile/Caption.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ public class Caption {

public String content="";

@Override
public String toString() {
return "Caption{" +
start + ".." + end +
", " + (style != null ? style.iD : null) + ", " + region + ": " + content +
'}';
}
}
15 changes: 14 additions & 1 deletion src/main/java/subtitleFile/Style.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,18 @@ protected static String defaultID() {
return "default"+styleCounter++;
}


@Override
public String toString() {
return "Style{" +
"id='" + iD + '\'' +
", font='" + font + '\'' +
", fontSize='" + fontSize + '\'' +
", color='" + color + '\'' +
", backgroundColor='" + backgroundColor + '\'' +
", textAlign='" + textAlign + '\'' +
", italic=" + italic +
", bold=" + bold +
", underline=" + underline +
'}';
}
}
11 changes: 9 additions & 2 deletions src/main/java/subtitleFile/Time.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,14 @@ protected String getTime(String format) {

return time.toString();
}



/**
* ASS/SSA time format.
* @return ASS/SSA time format.
*/
@Override
public String toString() {
return getTime("h:mm:ss.cs");
}

}
4 changes: 2 additions & 2 deletions src/main/java/subtitleFile/TimedTextFileFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/**
* This class specifies the interface for any format supported by the converter, these formats must
* create a {@link TimedTextObject} from an {@link InputStream} (so it can process files form standard In or uploads)
* create a {@link TimedTextObject} from an {@link java.io.InputStream} (so it can process files form standard In or uploads)
* and return a String array for text formats, or byte array for binary formats.
* <br><br>
* Copyright (c) 2012 J. David Requejo <br>
Expand Down Expand Up @@ -37,7 +37,7 @@ public interface TimedTextFileFormat {
*
* @param path String that contains the path to the file
* @return TimedTextObject representing the parsed file
* @throws IOException when having trouble reading the file from the given path
* @throws java.io.IOException when having trouble reading the file from the given path
*/
TimedTextObject parseFile(String fileName, InputStream is) throws IOException, FatalParsingException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/subtitleFile/TimedTextObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.TreeMap;

/**
* These objects can (should) only be created through the implementations of parseFile() in the {@link TimedTextFileFormat} interface
* These objects can (should) only be created through the implementations of parseFile() in the {@link subtitleFile.TimedTextFileFormat} interface
* They are an object representation of a subtitle file and contain all the captions and associated styles.
* <br><br>
* Copyright (c) 2012 J. David Requejo <br>
Expand Down

0 comments on commit 26f3a0d

Please sign in to comment.