org.gcube.common.searchservice.searchlibrary.resultset.helpers
Class RecordParser

java.lang.Object
  extended by org.gcube.common.searchservice.searchlibrary.resultset.helpers.RecordParser

public class RecordParser
extends java.lang.Object

Helper class used by the ResultSet element

Author:
UoA

Constructor Summary
RecordParser()
          Creates a new RecordParser
 
Method Summary
 java.util.Vector<java.lang.Integer> containsRecord(java.lang.String line)
          Checks if the provided string contains any records, parses them and retrieves a vector holding the offset they start from in the string
 java.util.Vector<java.lang.String> getFullRecords(java.lang.String line, java.util.Vector<java.lang.Integer> count)
          Retrieves the full records available in the provided string as they are denoted by the provided offsets
 java.lang.String getHead(java.lang.String line, int offset)
          Retrives the part of the proovided string that is before the given offset
 java.lang.String getTail(java.lang.String line, int offset)
          Retrives the part of the proovided string that is after the given offset
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordParser

public RecordParser()
Creates a new RecordParser

Method Detail

containsRecord

public java.util.Vector<java.lang.Integer> containsRecord(java.lang.String line)
Checks if the provided string contains any records, parses them and retrieves a vector holding the offset they start from in the string

Parameters:
line - The line to parse
Returns:
The offset of the records

getHead

public java.lang.String getHead(java.lang.String line,
                                int offset)
Retrives the part of the proovided string that is before the given offset

Parameters:
line - The string to use
offset - The offset to use
Returns:
The required substring

getTail

public java.lang.String getTail(java.lang.String line,
                                int offset)
Retrives the part of the proovided string that is after the given offset

Parameters:
line - The string to use
offset - The offset to use
Returns:
The required substring

getFullRecords

public java.util.Vector<java.lang.String> getFullRecords(java.lang.String line,
                                                         java.util.Vector<java.lang.Integer> count)
Retrieves the full records available in the provided string as they are denoted by the provided offsets

Parameters:
line - The string to use
count - A vector holding the offsets of the strings
Returns:
A vector holding the retrieved records