Open SiteSearch 4.1.1
Final

ORG.oclc.db
Class SortKey

java.lang.Object
  |
  +--ORG.oclc.db.SortKey
Direct Known Subclasses:
FieldKey

public class SortKey
extends Object

SortKey is the controlling class for building a sort key from a record. SortKey must be extended to actually get any data in a sort key.


Field Summary
protected  boolean caseSensitive
          boolean data type indicating whether the key should be case sensitive
protected  int dataLen
          The number of bytes to get in the field.
protected  int dataOffset
          The dataOffset for the key in the field.
static String defaultFillkey
          Default fill characters.
 String fillkey
          String fillKey for records that don't contain the data specified sort key data.
 boolean isfill
          boolean data type indicating whether the sortkey is all fill characters.
protected  Class keyClass
           
protected  int keyLength
          Length of a key field.
protected  boolean punctuationSensitive
          boolean data type indicating whether the key should be punctuationSensitive;
protected  boolean reverse
          Flag to sort in descending sequence.
protected  Sorts sort
          Object describing available sorts
protected  String[] sortParms
          the path paramaters for the sort.
protected  boolean stripArticles
          Flag to strip articles from the front of a field
 
Constructor Summary
SortKey(Sorts sort, String[] keys, int[] order)
          Define a key for a sort by calling this.
 
Method Summary
 String getKey(DataDir record)
          Builds a sort key from each of the components of the key.
 boolean isFill()
           
protected  String normalizeKey(byte[] key, int offset, int length, int maxlen)
          Apply normalization rules to key.
 void setCaseSensitive(boolean caseSensitiveFlag)
          Sets the sortkey case sensitive flag.
 void setPunctuationSensitive(boolean punctuationSensitiveFlag)
          Sets the sortkey punctuation sensitive flag.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sortParms

protected String[] sortParms
the path paramaters for the sort.

keyLength

protected int keyLength
Length of a key field.

reverse

protected boolean reverse
Flag to sort in descending sequence.

stripArticles

protected boolean stripArticles
Flag to strip articles from the front of a field

sort

protected Sorts sort
Object describing available sorts

dataOffset

protected int dataOffset
The dataOffset for the key in the field.

dataLen

protected int dataLen
The number of bytes to get in the field.

caseSensitive

protected boolean caseSensitive
boolean data type indicating whether the key should be case sensitive

punctuationSensitive

protected boolean punctuationSensitive
boolean data type indicating whether the key should be punctuationSensitive;

keyClass

protected Class keyClass

fillkey

public String fillkey
String fillKey for records that don't contain the data specified sort key data.

isfill

public boolean isfill
boolean data type indicating whether the sortkey is all fill characters.

defaultFillkey

public static String defaultFillkey
Default fill characters.
Constructor Detail

SortKey

public SortKey(Sorts sort,
               String[] keys,
               int[] order)
        throws Diagnostic1
Define a key for a sort by calling this. Sortkey then builds an array of SortKeys that will do the actual work of building the key.
Parameters:
sort - object describing available sorts
keys - description of keys
order - order for sorting each key
Throws:
Diagnostic1 - if the request was not syntactically correct
Method Detail

setCaseSensitive

public void setCaseSensitive(boolean caseSensitiveFlag)
Sets the sortkey case sensitive flag.
Parameters:
caseSensitiveFlag - true=caseSensitive/false=caseInsensitive

setPunctuationSensitive

public void setPunctuationSensitive(boolean punctuationSensitiveFlag)
Sets the sortkey punctuation sensitive flag.
Parameters:
punctuationSensitiveFlag - true=punctuationSensitive / false=punctuationInsensitive

getKey

public String getKey(DataDir record)
Builds a sort key from each of the components of the key.
Parameters:
record - input record
Returns:
key

toString

public String toString()
Overrides:
toString in class Object

isFill

public boolean isFill()

normalizeKey

protected String normalizeKey(byte[] key,
                              int offset,
                              int length,
                              int maxlen)
Apply normalization rules to key. Strip puncuation, special characters and leading articles. Convert and lowercase other characters.
Parameters:
key - byte array containing key
offset - of key in key
length - of key in key
Returns:
normalized key

Open SiteSearch 4.1.1
Final