Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum
Class QueryResult

java.lang.Object
  extended by com.jivesoftware.forum.QueryResult
All Implemented Interfaces:
Cacheable, com.tangosol.io.ExternalizableLite, java.io.Serializable

public class QueryResult
extends java.lang.Object
implements Cacheable, com.tangosol.io.ExternalizableLite

Encapsulates a search result resulting from a search using the Query class. Relevance is only stored to 3 significant decimal places (xx.x%)

See Also:
Serialized Form

Constructor Summary
QueryResult(ForumMessage message, float relevance)
          Creates a new QueryResult object.
QueryResult(long messageID, long threadID, long forumID, java.lang.String subject, java.util.Date creationDate, java.util.Date modificationDate, float relevance)
          Creates a new QueryResult object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getCachedSize()
          Returns the approximate size of the Object in bytes.
 java.util.Date getCreationDate()
          Get the creation date of the message this query result pertains to.
 long getForumID()
          Get the ID of the forum the message belongs to
 ForumMessage getMessage()
          Get the message this query result pertains to.
 long getMessageID()
          Get the id of the message this query result pertains to.
 java.util.Date getModificationDate()
          Returns the message modification date.
 float getRelevance()
          Get the relevance of this query result as determined by the search engine.
 java.lang.String getRelevanceAsPercentage(java.util.Locale locale)
          Returns the relevance as a percentage (no decimal places) formatted according to the locale passed in.
 java.lang.String getSubject()
          Returns the message's subject.
 long getThreadID()
          Get the ID of the thread the message belongs to
 int hashCode()
           
 void readExternal(java.io.DataInput in)
           
 void setMessage(ForumMessage message)
          Set the entry this query result pertains to.
protected  void setRelevance(float relevance)
          Get the relevance of this query result as determined by the search engine.
 void writeExternal(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResult

public QueryResult(ForumMessage message,
                   float relevance)
Creates a new QueryResult object.

Parameters:
message - the ForumMessage corresponding to the query result
relevance - the relevance of the search result as determined by the search engine.

QueryResult

public QueryResult(long messageID,
                   long threadID,
                   long forumID,
                   java.lang.String subject,
                   java.util.Date creationDate,
                   java.util.Date modificationDate,
                   float relevance)
Creates a new QueryResult object.

Parameters:
messageID - the messageID of the ForumMessage corresponding to the query result
relevance - the relevance of the search result as determined by the search engine.
threadID - the ID of the message's parent thread
forumID - the ID of the message's parent forum
modificationDate - the date the message was last modified
subject - the subject of the message
Since:
4.0
Method Detail

getMessageID

public long getMessageID()
Get the id of the message this query result pertains to.

Returns:
the id of the message this query result pertains to.

getThreadID

public long getThreadID()
Get the ID of the thread the message belongs to

Returns:
the ID of the thread the message belongs to
Since:
4.0

getForumID

public long getForumID()
Get the ID of the forum the message belongs to

Returns:
the ID of the forum the message belongs to
Since:
4.0

getCreationDate

public java.util.Date getCreationDate()
Get the creation date of the message this query result pertains to.

Returns:
the creation date of the message this query result pertains to.

getModificationDate

public java.util.Date getModificationDate()
Returns the message modification date. This may not be the most current modification date but rather is likely to be the modification date of the message the last time it was added to the search index.

Returns:
the message modification date.
Since:
1.1

getSubject

public java.lang.String getSubject()
Returns the message's subject. This may not be the most current subject but rather is likely to be the subject of the message the last time it was added to the search index.

Returns:
the message's subject
Since:
1.1

getMessage

public ForumMessage getMessage()
                        throws ForumMessageNotFoundException
Get the message this query result pertains to.

Returns:
the message this query result pertains to.
Throws:
ForumMessageNotFoundException

getRelevance

public float getRelevance()
Get the relevance of this query result as determined by the search engine.

Returns:
the relevance of this query result as determined by the search engine.

setMessage

public void setMessage(ForumMessage message)
Set the entry this query result pertains to. This is used internally by Jive classes and isn't meant to be used by skin authors.

Parameters:
message - the ForumMessage this query result pertains to.

setRelevance

protected void setRelevance(float relevance)
Get the relevance of this query result as determined by the search engine. This is used internally by Jive classes and isn't meant to be used by skin authors.

Parameters:
relevance - the relevance of this query result as determined by the search engine.

getRelevanceAsPercentage

public java.lang.String getRelevanceAsPercentage(java.util.Locale locale)
Returns the relevance as a percentage (no decimal places) formatted according to the locale passed in.

Parameters:
locale - the locale to use to format the percentage.
Returns:
the formatted percentage as a String.

getCachedSize

public int getCachedSize()
Description copied from interface: Cacheable
Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.

Specified by:
getCachedSize in interface Cacheable
Returns:
the size of the Object in bytes.

readExternal

public void readExternal(java.io.DataInput in)
                  throws java.io.IOException
Specified by:
readExternal in interface com.tangosol.io.ExternalizableLite
Throws:
java.io.IOException

writeExternal

public void writeExternal(java.io.DataOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface com.tangosol.io.ExternalizableLite
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.