Update the javadoc comments
Project: http://git-wip-us.apache.org/repos/asf/incubator-reef/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-reef/commit/09ea37b4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/09ea37b4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/09ea37b4 Branch: refs/heads/REEF-395 Commit: 09ea37b48eb622113b622abef509105c718668b5 Parents: 8378efb Author: Yunseong Lee <[email protected]> Authored: Sun Jun 21 16:58:16 2015 +0900 Committer: Yunseong Lee <[email protected]> Committed: Sun Jun 21 16:58:16 2015 +0900 ---------------------------------------------------------------------- .../tang/formats/ClassHierarchySerializer.java | 52 ++++++++++++++++---- 1 file changed, 42 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/09ea37b4/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ClassHierarchySerializer.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ClassHierarchySerializer.java b/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ClassHierarchySerializer.java index bf3918b..c5a77ae 100644 --- a/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ClassHierarchySerializer.java +++ b/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ClassHierarchySerializer.java @@ -7,37 +7,69 @@ import org.apache.reef.tang.formats.avro.AvroNode; import java.io.*; /** - * + * A base interface for ClassHierarchy serializers. */ @DefaultImplementation(org.apache.reef.tang.formats.AvroClassHierarchySerializer.class) public interface ClassHierarchySerializer { /** - * serialize a class hierarchy into a file. + * Writes a ClassHierarchy into a file. * - * @param file - * @param classHierarchy - * @throws IOException + * @param classHierarchy the ClassHierarchy to store + * @param file the file to store the ClassHierarchy + * @throws IOException if there is an error in the process */ void toFile(final ClassHierarchy classHierarchy, final File file) throws IOException; + /** + * Writes a ClassHierarchy into a text file. + * + * @param classHierarchy the ClassHierarchy to store + * @param file the text file to store the ClassHierarchy + * @throws IOException if there is an error in the process + */ void toTextFile(final ClassHierarchy classHierarchy, final File file) throws IOException; + /** + * Serializes a ClassHierarchy as a byte[]. + * + * @param classHierarchy the ClassHierarchy to store + * @throws IOException if there is an error in the process + */ byte[] toByteArray(final ClassHierarchy classHierarchy) throws IOException; + /** + * Serializes a ClassHierarchy as a String. + * @param classHierarchy + * @param classHierarchy the ClassHierarchy to store + * @throws IOException if there is an error in the process + */ String toString(final ClassHierarchy classHierarchy) throws IOException; /** - * Deserialize a class hierarchy from a file. The file can be generated from either Java or C# - * - * @param file - * @return - * @throws IOException + * Loads a ClassHierarchy from a file created with toFile(). + * @param file the File to read from + * @throws IOException if the File can't be read or parsed */ ClassHierarchy fromFile(final File file) throws IOException; + /** + * Loads a ClassHierarchy from a text file created with toTextFile(). + * @param file the File to read from + * @throws IOException if the File can't be read or parsed + */ ClassHierarchy fromTextFile(final File file) throws IOException; + /** + * Deserializes a ClassHierarchy from a byte[] created with toByteArray(). + * @param theBytes the byte[] to deserialize + * @throws IOException if the byte[] can't be read or parsed + */ ClassHierarchy fromByteArray(final byte[] theBytes) throws IOException; + /** + * Deserializes a ClassHierarchy from a String created with toString(). + * @param theString the String to deserialize + * @throws IOException if the String can't be read or parsed + */ ClassHierarchy fromString(final String theString) throws IOException; }
