Class EstraierPure::NodeResult
In: lib/vendor/estraierpure.rb
Parent: Object

Abstraction of result set from node.

Methods

doc_num   get_doc   hint   new  

Public Class methods

Create a node result object.

[Source]

     # File lib/vendor/estraierpure.rb, line 420
420:     def initialize(docs, hints)
421:       Utility::check_types({ docs=>Array, hints=>Hash }) if $DEBUG
422:       @docs = docs
423:       @hints = hints
424:     end

Public Instance methods

Get the number of documents. The return value is the number of documents.

[Source]

     # File lib/vendor/estraierpure.rb, line 397
397:     def doc_num()
398:       @docs.length
399:     end

Get the value of hint information. The return value is a result document object or `nil’ if the index is out of bounds.

[Source]

     # File lib/vendor/estraierpure.rb, line 402
402:     def get_doc(index)
403:       Utility::check_types({ index=>Integer }) if $DEBUG
404:       return nil if index < 0 || index >= @docs.length
405:       @docs[index]
406:     end

Get the value of hint information. `key’ specifies the key of a hint. "VERSION", "NODE", "HIT", "HINT#n", "DOCNUM", "WORDNUM", "TIME", "LINK#n", and "VIEW" are provided for keys. The return value is the hint or `nil’ if the key does not exist.

[Source]

     # File lib/vendor/estraierpure.rb, line 411
411:     def hint(key)
412:       Utility::check_types({ key=>String }) if $DEBUG
413:       @hints[key]
414:     end

[Validate]