medisyn
Class ResultParser

java.lang.Object
  extended by medisyn.ResultParser

public class ResultParser
extends java.lang.Object

Parses the output of the medisyn output files. Manages the resulting video requests and video files.

Author:
Leo Bosnjak

Nested Class Summary
private  class ResultParser.ParseLineResult
          represents the result of the line-parsing
 
Field Summary
private static java.lang.String DEFAULT_INPUT_FILE
           
private static java.lang.String DEFAULT_USERINFO_FILE
           
private  java.lang.String inputFile
           
private  java.util.Vector<Request> requests
           
private static java.lang.String START_FOLDER
           
private  java.lang.String userinfoFile
           
private  java.util.Hashtable<java.lang.Integer,VideoFile> videoFiles
           
 
Constructor Summary
ResultParser()
          constructs the parser with default medisyn-inputfile and medisyn-userinfofile
ResultParser(java.lang.String customInputFile, java.lang.String customUserinfoFile)
          constructs the parser with custom medisyn-inputfile and medisyn-userinfofile
 
Method Summary
 java.util.Vector<Request> getRequests()
           
 java.util.Hashtable<java.lang.Integer,VideoFile> getVideoFiles()
           
private  ResultParser.ParseLineResult parseIntFromLine(java.lang.String line, char separator)
          parses one int from a line in which the values are separated by tabs
 boolean parseRequestLog()
          Parse the medisyn generated request.log
 boolean parseUserInfo()
          parse the medisyn generated userinfo.txt which contains the FileID, Popularity, Duration and Bitrate of each file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_FOLDER

private static final java.lang.String START_FOLDER
See Also:
Constant Field Values

DEFAULT_INPUT_FILE

private static final java.lang.String DEFAULT_INPUT_FILE
See Also:
Constant Field Values

DEFAULT_USERINFO_FILE

private static final java.lang.String DEFAULT_USERINFO_FILE
See Also:
Constant Field Values

requests

private java.util.Vector<Request> requests

videoFiles

private java.util.Hashtable<java.lang.Integer,VideoFile> videoFiles

inputFile

private java.lang.String inputFile

userinfoFile

private java.lang.String userinfoFile
Constructor Detail

ResultParser

public ResultParser()
constructs the parser with default medisyn-inputfile and medisyn-userinfofile


ResultParser

public ResultParser(java.lang.String customInputFile,
                    java.lang.String customUserinfoFile)
constructs the parser with custom medisyn-inputfile and medisyn-userinfofile

Method Detail

parseRequestLog

public boolean parseRequestLog()
                        throws java.lang.Exception
Parse the medisyn generated request.log

Returns:
true - if successful
Throws:
java.lang.Exception

parseUserInfo

public boolean parseUserInfo()
                      throws java.lang.Exception
parse the medisyn generated userinfo.txt which contains the FileID, Popularity, Duration and Bitrate of each file

Returns:
true - if successful
Throws:
java.lang.Exception

parseIntFromLine

private ResultParser.ParseLineResult parseIntFromLine(java.lang.String line,
                                                      char separator)
                                               throws java.lang.Exception
parses one int from a line in which the values are separated by tabs

Parameters:
line -
Returns:
ParseLineResult - one result line
Throws:
java.lang.Exception

getRequests

public java.util.Vector<Request> getRequests()
Returns:
the requests

getVideoFiles

public java.util.Hashtable<java.lang.Integer,VideoFile> getVideoFiles()
Returns:
the videoFiles