|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.ucsb.adl.middleware.DateRanker
Ranks query results by date. Dates are drawn from mappings to the
adl:dates bucket; items lacking any such mappings are
assigned a minimal rank.
$Log: DateRanker.java,v $
Revision 1.3 2004/09/05 21:48:13 gjanee
Bug fix.
Revision 1.2 2003/06/10 04:14:51 gjanee
Almost total rewrite to conform to the new ADL bucket view and to
the new Ranker interface, and to employ the new
validating XML parser.
Revision 1.1 2000/03/01 05:32:27 gjanee
Initial revision
| Method Summary | |
void |
characters(char[] string,
int start,
int length)
For use by ValidatingXmlParser only. |
static edu.ucsb.adl.middleware.DateRanker |
createRanker(java.lang.String order)
Creates a DateRanker. |
void |
endElement(int elementCode)
For use by ValidatingXmlParser only. |
static void |
main(java.lang.String[] args)
Test driver. |
double |
rank(edu.ucsb.adl.middleware.Result result,
edu.ucsb.adl.middleware.Query query)
Ranks a query result. |
void |
startElement(int elementCode,
java.lang.String[] attributes)
For use by ValidatingXmlParser only. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static edu.ucsb.adl.middleware.DateRanker createRanker(java.lang.String order)
throws InternalErrorException
DateRanker. The ranker may be invoked
multiple times, but is not multithread-safe.
order - The order of the ranking. "ascending"
("descending") indicates that later (earlier)
results have higher rank.
DateRanker.
InternalErrorException - If order is invalid.
public double rank(edu.ucsb.adl.middleware.Result result,
edu.ucsb.adl.middleware.Query query)
throws InternalErrorException
rank in interface Rankerresult - The result.query - Unused.
InternalErrorException - If an error occurs parsing the report.
public void startElement(int elementCode,
java.lang.String[] attributes)
ValidatingXmlParser only.
startElement in interface XmlHandlerelementCode - The element's code.attributes - Element attribute values, indexed by attribute code. All of
the element's declared attributes are represented in the array;
attributes for which a value is specified in the document or
for which there is a DTD-specified default have
non-null values. The handler should reference the
array for the duration of the call only, as it is reused by the
parser. Also, the array may be longer than necessary.
public void endElement(int elementCode)
throws XmlException
ValidatingXmlParser only.
endElement in interface XmlHandlerelementCode - The element's code.
XmlException - If any error occurs.
public void characters(char[] string,
int start,
int length)
ValidatingXmlParser only.
characters in interface XmlHandlerstring - The textual content.start - The index in string at which the textual content
starts.length - The length of the content.
public static void main(java.lang.String[] args)
throws java.io.IOException,
InternalErrorException
java.io.IOException
InternalErrorException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||