Class TopicMapSearchResult

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

public class TopicMapSearchResult extends 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 Details

  • Constructor Details

  • Method Details

    • getObjectIdField

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

      public void setObjectIdField(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 List<TMObjectIF>
      Specified by:
      get in class AbstractList<TMObjectIF>
    • size

      public int size()
      INTERNAL: This is the java.util.List.size() method.
      Specified by:
      size in interface Collection<TMObjectIF>
      Specified by:
      size in interface List<TMObjectIF>
      Specified by:
      size in class AbstractCollection<TMObjectIF>