net.ontopia.infoset.fulltext.topicmaps
Class TopicMapSearchResult

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<TMObjectIF>
          extended by net.ontopia.infoset.fulltext.topicmaps.TopicMapSearchResult
All Implemented Interfaces:
java.lang.Iterable<TMObjectIF>, java.util.Collection<TMObjectIF>, java.util.List<TMObjectIF>

public class TopicMapSearchResult
extends java.util.AbstractList<TMObjectIF>

INTERNAL: A List implementation that wraps a SearchResultIF to present the actual topic map objects referenced in the search result. The 'object_id' document field is used by default to look up topic map objects by their object ids. This field can be changed by setting the objectIdField property.

Example:

 TopicMapSearchResult tmobjects = new TopicMapSearchResult(topicmap, searcher.search("verdi"));
 Iterator iter = tmobjects.iterator();
 while (iter.hasNext()) {
   System.out.println(iter.next());
 }
 
Output:

 [basic.TopicName, 790, 'Verdi, Giuseppe']
 [basic.TopicName, 791, 'Giuseppe Verdi']
 [basic.TopicName, 705, 'Land of Verdi']]
 


Field Summary
protected  java.lang.String id_field
           
protected  SearchResultIF result
           
protected  TopicMapIF topicmap
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
TopicMapSearchResult(TopicMapIF topicmap, SearchResultIF result)
           
 
Method Summary
 TMObjectIF get(int index)
          INTERNAL: This is the java.util.List.get(int) method.
 java.lang.String getObjectIdField()
          INTERNAL: Returns the name of the field that contains the topic map object id.
 float getScore(int index)
          INTERNAL: The score of the result row.
 void setObjectIdField(java.lang.String id_field)
          INTERNAL: Sets the name of the field that contains the topic map object id.
 int size()
          INTERNAL: This is the java.util.List.size() method.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

topicmap

protected TopicMapIF topicmap

result

protected SearchResultIF result

id_field

protected java.lang.String id_field
Constructor Detail

TopicMapSearchResult

public TopicMapSearchResult(TopicMapIF topicmap,
                            SearchResultIF result)
Method Detail

getObjectIdField

public java.lang.String getObjectIdField()
INTERNAL: Returns the name of the field that contains the topic map object id.


setObjectIdField

public void setObjectIdField(java.lang.String id_field)
INTERNAL: Sets the name of the field that contains the topic map object id.


getScore

public float getScore(int index)
INTERNAL: The score of the result row.


get

public TMObjectIF get(int index)
INTERNAL: This is the java.util.List.get(int) method.

Specified by:
get in interface java.util.List<TMObjectIF>
Specified by:
get in class java.util.AbstractList<TMObjectIF>

size

public int size()
INTERNAL: This is the java.util.List.size() method.

Specified by:
size in interface java.util.Collection<TMObjectIF>
Specified by:
size in interface java.util.List<TMObjectIF>
Specified by:
size in class java.util.AbstractCollection<TMObjectIF>


Copyright © 2000-2012 Ontopia.