Open SiteSearch 4.1.1
Final

ORG.oclc.z39
Class TermInfo

java.lang.Object
  |
  +--ORG.oclc.z39.TermInfo

public class TermInfo
extends Object

TermInfo is returned by a Z39-50 Scan request.


Field Summary
 Attribute[] a
          The use/structure attributes in the Z3950 response.
 String alternativeTerm
          The alternative term for the term.
 byAttributes[] b
          The per-database breakdown for the term.
 String displayTerm
          The display term for the term.
 int globalOccurrences
          The total number of occurrences for the term.
 Object otherInformationData
          Object containing the parsed OtherInformation data associated with the term.
 String Term
          The term.
 int termType
          The term type returned in the Z3950 response.
 
Constructor Summary
TermInfo()
          Construct an object.
TermInfo(DataDir termInfo)
          Construct an object from the Z3950 response.
TermInfo(String term, String displayTerm)
          Construct an object.
 
Method Summary
 void addByAttribute(Attribute[] a, String dbName, int postings)
          Add these attributes to this term.
 void addByAttribute(TermInfo otherTerm, String dbName, Attribute[] defaultAttrs)
          Merge the byAttribute of otherTerm with the byAttribute of this term.
 String alternativeTerm()
          Accessor method to the alternativeTerm.
static DataDir buildDir(String term, String displayTerm, Attribute[] a, int globalOccurrences, byAttributes[] b)
           
static DataDir buildDir(String term, String displayTerm, Attribute[] a, int globalOccurrences, byAttributes[] b, String alternativeTerm, int use, int structure, DataDir otherInfoDir)
          Build a DataDir TermInfo from the parameters.
static DataDir buildDir(TermInfo t)
          Build a DataDir TermInfo from the TermInfo object.
 int compareTo(String anotherTerm)
          Compare the input term to the scan Term.
 int compareTo(TermInfo anotherTerm)
          Compare this TermInfo object to another TermInfo object.
 int compareToI(String anotherTerm)
           
 int compareToI(TermInfo anotherTerm)
           
 String displayTerm()
          Accessor method to the displayTerm.
 int getFirstDBOffset()
          Get the index to the byAttributes array for the first database that has postings for the scan Term.
 int getFirstUse()
          Find the offset into the byAttributes array for the first entry with the use attribute of BIB1.
 int getNumGTZero()
           
 String getRawText()
          Get the original scan Term.
 String getText()
           
 void mergeDbOccurrences(String newName)
          Combine the by database information into a single count with the specified database name.
 void setByAttribute(String dbName, Attribute[] defaultAttrs)
          If byAttribute does not exist, create one.
 String Term()
          Accessor method to the Term.
 int termCount()
          Get the total number of postings for the scan Term.
 int termType()
           
 String toString()
          Generate a String representation of the object.
 void trim(int n)
          Clean up Term to be a displayTerm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Term

public String Term
The term.

displayTerm

public String displayTerm
The display term for the term.

alternativeTerm

public String alternativeTerm
The alternative term for the term.

termType

public int termType
The term type returned in the Z3950 response.

a

public Attribute[] a
The use/structure attributes in the Z3950 response.

globalOccurrences

public int globalOccurrences
The total number of occurrences for the term.

b

public byAttributes[] b
The per-database breakdown for the term.

otherInformationData

public Object otherInformationData
Object containing the parsed OtherInformation data associated with the term. The Object can be a notisScanOtherInformation object, or a horizonScanOtherInformation object(not implemented yet), the caller must identify it.
Constructor Detail

TermInfo

public TermInfo()
Construct an object.

TermInfo

public TermInfo(String term,
                String displayTerm)
Construct an object.
Parameters:
term - the scanned term
displayterm - the term to display

TermInfo

public TermInfo(DataDir termInfo)
         throws Diagnostic1
Construct an object from the Z3950 response.
Parameters:
termInfo - the datadir containing the scan response
Method Detail

getNumGTZero

public int getNumGTZero()
Returns:
the number of attributes with non-zero counts for this term

getFirstDBOffset

public int getFirstDBOffset()
Get the index to the byAttributes array for the first database that has postings for the scan Term.
Returns:
int

getText

public final String getText()

getRawText

public final String getRawText()
Get the original scan Term.
Returns:
String

termCount

public final int termCount()
Get the total number of postings for the scan Term.
Returns:
int - globalOccurrences

displayTerm

public final String displayTerm()
Accessor method to the displayTerm.
Returns:
String

alternativeTerm

public final String alternativeTerm()
Accessor method to the alternativeTerm.
Returns:
String

termType

public final int termType()

Term

public final String Term()
Accessor method to the Term.
Returns:
String

trim

public void trim(int n)
Clean up Term to be a displayTerm.

getFirstUse

public int getFirstUse()
Find the offset into the byAttributes array for the first entry with the use attribute of BIB1.
Returns:
the first use attribute for this term

mergeDbOccurrences

public void mergeDbOccurrences(String newName)
Combine the by database information into a single count with the specified database name.
Parameters:
newName - the new database name

compareTo

public int compareTo(String anotherTerm)
Compare the input term to the scan Term.
Parameters:
anotherTerm - compare this term to anotherTerm
Returns:
true if the terms are equal

compareToI

public int compareToI(String anotherTerm)

compareTo

public int compareTo(TermInfo anotherTerm)
Compare this TermInfo object to another TermInfo object.
Parameters:
anotherTerm - compare this term to anotherTerm
Returns:
true if the terms are equal

compareToI

public int compareToI(TermInfo anotherTerm)

setByAttribute

public void setByAttribute(String dbName,
                           Attribute[] defaultAttrs)
If byAttribute does not exist, create one. If attributes exist, create the byAttribute from the dbName and attributes. If attributes does not exist, create byAttribute from the default attributes and the dbName.
Parameters:
dbName - database name for byAttribute
defaultAttrs - list of default attributes

addByAttribute

public void addByAttribute(TermInfo otherTerm,
                           String dbName,
                           Attribute[] defaultAttrs)
Merge the byAttribute of otherTerm with the byAttribute of this term.
Parameters:
otherTerm - term containing attributes to merge with this term
dbName - database name for these attributes
defaultAttrs - default attributes for this term

addByAttribute

public void addByAttribute(Attribute[] a,
                           String dbName,
                           int postings)
Add these attributes to this term.
Parameters:
a - attributes to add
dbName - database name for attributes
postings - record count for attributes

buildDir

public static DataDir buildDir(String term,
                               String displayTerm,
                               Attribute[] a,
                               int globalOccurrences,
                               byAttributes[] b)

buildDir

public static DataDir buildDir(String term,
                               String displayTerm,
                               Attribute[] a,
                               int globalOccurrences,
                               byAttributes[] b,
                               String alternativeTerm,
                               int use,
                               int structure,
                               DataDir otherInfoDir)
Build a DataDir TermInfo from the parameters.
Parameters:
term - the scan term
displayTerm - the display term
a - the attributes for the term
globalOccurrences - the the number of occurrences
b - the breakdown by database of scan results
Returns:
DataDir

buildDir

public static DataDir buildDir(TermInfo t)
Build a DataDir TermInfo from the TermInfo object.
Parameters:
t - the TermInfo object
Returns:
DataDir

toString

public String toString()
Generate a String representation of the object.
Overrides:
toString in class Object

Open SiteSearch 4.1.1
Final