anl.aida.util
Class StandardIndexLineParser

java.lang.Object
  extended by anl.aida.util.StandardIndexLineParser

public class StandardIndexLineParser
extends java.lang.Object

Parses a line in the standard index format. The format is: date_in_millis:::url:::title:::author with author being optional.


Field Summary
static int AUTHOR
           
private static java.lang.String DELIMITER
           
static int TIMESTAMP
           
static int TITLE
           
static int URL
           
 
Constructor Summary
StandardIndexLineParser()
           
 
Method Summary
 java.lang.String[] parse(java.lang.String line, java.lang.String[] result)
          Parses the line into four strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITER

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

TIMESTAMP

public static final int TIMESTAMP
See Also:
Constant Field Values

URL

public static final int URL
See Also:
Constant Field Values

TITLE

public static final int TITLE
See Also:
Constant Field Values

AUTHOR

public static final int AUTHOR
See Also:
Constant Field Values
Constructor Detail

StandardIndexLineParser

public StandardIndexLineParser()
Method Detail

parse

public java.lang.String[] parse(java.lang.String line,
                                java.lang.String[] result)
Parses the line into four strings. One each for the timestamp in milliseconds, url, title, and author. The result is returned in a String[]. This will use the specified String[] if it is not null and of length 4. The constants TIMESTAMP etc. can be used as indices into the returned array.

Parameters:
line - the line to parse
result - an optional array to store the results in
Returns:
the parsed results.