moj.lang.statserv.modules
Class StatServRequest

java.lang.Object
  extended by moj.lang.statserv.modules.StatServRequest
Direct Known Subclasses:
LemmaTagRequest, WordTagRequest

public abstract class StatServRequest
extends java.lang.Object

StatServRequest in an abstract class that stipulates what fields and methods a StatServ request module at least should supply and implement.

Version:
2007-Sept-21
Author:
Martin Hassel

Field Summary
 java.lang.String classname
           
 
Method Summary
 boolean addReferenceSet(java.lang.String docset)
          Add a document set to request reference statistics from.
 boolean addReferenceSets(java.util.Set<java.lang.String> docsets)
          Add a set of document sets to request reference statistics from.
 java.lang.String addStatsToSet(java.lang.String docset)
          Specify a document set to add local statistics for the current request to.
 boolean checkSimilarity(boolean check_similarity)
          Turns the similarity check, when adding local statistics for the current request to chosen document set, on or off.
 boolean getLocalStats(boolean localstats)
          Turns retrieval of "local" statistics on or off.
abstract  boolean parse(java.io.Reader xmlReader)
          Parses the XML passed via the Reader and fills the modules data structures.
abstract  java.lang.String requestXML()
          Returns the XML that constitutes the modules part in a StatServConnection request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classname

public final java.lang.String classname
Method Detail

getLocalStats

public boolean getLocalStats(boolean localstats)
Turns retrieval of "local" statistics on or off.

Parameters:
localstats - true for on, false for off
Returns:
previous state

addReferenceSet

public boolean addReferenceSet(java.lang.String docset)
Add a document set to request reference statistics from.

Parameters:
docset - document set to add to request
Returns:
true on success

addReferenceSets

public boolean addReferenceSets(java.util.Set<java.lang.String> docsets)
Add a set of document sets to request reference statistics from.

Parameters:
docsets - document sets to add to request
Returns:
true on success

checkSimilarity

public boolean checkSimilarity(boolean check_similarity)
Turns the similarity check, when adding local statistics for the current request to chosen document set, on or off.

Parameters:
check_similarity - true for on, false for off
Returns:
previous state

addStatsToSet

public java.lang.String addStatsToSet(java.lang.String docset)
Specify a document set to add local statistics for the current request to.

Parameters:
docset - document set to add local statistics to
Returns:
name of previously specified document set, if any

requestXML

public abstract java.lang.String requestXML()
Returns the XML that constitutes the modules part in a StatServConnection request.

Returns:
XML representing the modules part in a request

parse

public abstract boolean parse(java.io.Reader xmlReader)
Parses the XML passed via the Reader and fills the modules data structures.

Parameters:
xmlReader - Reader wrapping the XML response from a StatServConnection request.
Returns:
true on success, else false