| Class | EstraierPure::NodeResult |
| In: |
lib/vendor/estraierpure.rb
|
| Parent: | Object |
Create a node result object.
# 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
Get the number of documents. The return value is the number of documents.
# 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.
# 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.
# File lib/vendor/estraierpure.rb, line 411
411: def hint(key)
412: Utility::check_types({ key=>String }) if $DEBUG
413: @hints[key]
414: end