org.apache.lucene.search.suggest
Class Lookup.LookupResult

java.lang.Object
  extended by org.apache.lucene.search.suggest.Lookup.LookupResult
All Implemented Interfaces:
Comparable<Lookup.LookupResult>
Enclosing class:
Lookup

public static final class Lookup.LookupResult
extends Object
implements Comparable<Lookup.LookupResult>

Result of a lookup.


Field Summary
 Object highlightKey
          Expert: custom Object to hold the result of a highlighted suggestion.
 CharSequence key
          the key's text
 BytesRef payload
          the key's payload (null if not present)
 long value
          the key's weight
 
Constructor Summary
Lookup.LookupResult(CharSequence key, long value)
          Create a new result from a key+weight pair.
Lookup.LookupResult(CharSequence key, long value, BytesRef payload)
          Create a new result from a key+weight+payload triple.
Lookup.LookupResult(CharSequence key, Object highlightKey, long value, BytesRef payload)
          Create a new result from a key+highlightKey+weight+payload triple.
 
Method Summary
 int compareTo(Lookup.LookupResult o)
          Compare alphabetically.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

key

public final CharSequence key
the key's text


highlightKey

public final Object highlightKey
Expert: custom Object to hold the result of a highlighted suggestion.


value

public final long value
the key's weight


payload

public final BytesRef payload
the key's payload (null if not present)

Constructor Detail

Lookup.LookupResult

public Lookup.LookupResult(CharSequence key,
                           long value)
Create a new result from a key+weight pair.


Lookup.LookupResult

public Lookup.LookupResult(CharSequence key,
                           long value,
                           BytesRef payload)
Create a new result from a key+weight+payload triple.


Lookup.LookupResult

public Lookup.LookupResult(CharSequence key,
                           Object highlightKey,
                           long value,
                           BytesRef payload)
Create a new result from a key+highlightKey+weight+payload triple.

Method Detail

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Lookup.LookupResult o)
Compare alphabetically.

Specified by:
compareTo in interface Comparable<Lookup.LookupResult>


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.