Open SiteSearch 4.1.1
Final

ORG.oclc.z39
Class byAttributes

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

public class byAttributes
extends Object

Object to maintain the per-database results for a Z39.50 scan.


Constructor Summary
byAttributes(Attribute[] a, String d, int n)
          Build a list of attributes for a term with database and posting information.
byAttributes(DataDir byAttribute)
          Build a list of attributes for a term with database and posting information from a TermInfo DataDir.
 
Method Summary
 void addOccurrences(String dbName, int postings)
          Adds a new database name and postings count to this attribute combination.
 boolean attributesMatch(Attribute[] a)
          Compare the input Attribute object to this object.
static DataDir buildDir(Attribute[] attributes, Vector databaseNames, Vector num)
          Build a DataDir from an Attribute object array.
static DataDir buildDir(byAttributes b)
          Build a DataDir from a byAttributes Object.
 String[] databaseNames()
          Get an array representation of all the database names in the scan.
 void mergeDbOccurrences(String newName)
          Merges multiple database names and counts into a single database name and count.
 Integer[] nums()
          Get an array representation of all the postings counts in the scan.
 void setDatabaseName(String name, int whichName)
          Set the databaseName in an attribute.
 String toString()
          Generate a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

byAttributes

public byAttributes(Attribute[] a,
                    String d,
                    int n)
Build a list of attributes for a term with database and posting information.

byAttributes

public byAttributes(DataDir byAttribute)
             throws Diagnostic1
Build a list of attributes for a term with database and posting information from a TermInfo DataDir.
Throws:
Diagnostic1 - when the input record is not formatted according to the standard
Method Detail

databaseNames

public String[] databaseNames()
Get an array representation of all the database names in the scan.
Returns:
String[]

nums

public Integer[] nums()
Get an array representation of all the postings counts in the scan.
Returns:
Integer[]

setDatabaseName

public void setDatabaseName(String name,
                            int whichName)
Set the databaseName in an attribute.
Parameters:
name - is the string to set the entry to
whichName - denotes the position in the databaseNames vector

mergeDbOccurrences

public void mergeDbOccurrences(String newName)
Merges multiple database names and counts into a single database name and count.
Parameters:
newName - name of the new merged database

attributesMatch

public boolean attributesMatch(Attribute[] a)
Compare the input Attribute object to this object.
Parameters:
a - the input Attribute
Returns:
true if the attributes specified by 'a' match this list of attributes

addOccurrences

public void addOccurrences(String dbName,
                           int postings)
Adds a new database name and postings count to this attribute combination.

buildDir

public static DataDir buildDir(Attribute[] attributes,
                               Vector databaseNames,
                               Vector num)
Build a DataDir from an Attribute object array.
Parameters:
attributes - attribute combination
databaseNames - list of databases with results
num - list of counts to go with database names
Returns:
a byAttributes DataDir built from the parameters

buildDir

public static DataDir buildDir(byAttributes b)
Build a DataDir from a byAttributes Object.
Returns:
a byAttributes DataDir built from the byAttributes object

toString

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

Open SiteSearch 4.1.1
Final