com.plumtree.remote.prc.search
Interface ISearchResult

All Known Subinterfaces:
IPortalSearchResult

public interface ISearchResult

Interface to return information about individual search results.


Method Summary
 boolean fieldExists(Field field)
          Whether a particular field is present in this ISearchResult.
 java.util.Date getFieldAsDate(Field field)
          Gets the value of the specified Field as a Date.
 float getFieldAsFloat(Field field)
          Gets the value of the specified Field as a float.
 int getFieldAsInt(Field field)
          Gets the value of the specified Field as an int.
 java.lang.Object getFieldAsObject(Field field)
          Gets the value of the specified Field as an Object.
 java.lang.String getFieldAsString(Field field)
          Gets the toString() value of the specified Field.
 java.util.Enumeration getFields()
          Gets an enumeration whose elements are Fields.
 

Method Detail

getFields

public java.util.Enumeration getFields()
Gets an enumeration whose elements are Fields.

Returns:
enumeration of Fields

fieldExists

public boolean fieldExists(Field field)
Whether a particular field is present in this ISearchResult.

Parameters:
field - Field to check
Returns:
true if field exists

getFieldAsString

public java.lang.String getFieldAsString(Field field)
Gets the toString() value of the specified Field. This method can be used for all Fields, as it does not check if the value is of type String.

Parameters:
field - Field to evaluate
Returns:
String value of field
Throws:
java.lang.IllegalArgumentException - if the field is not present in this ISearchResult

getFieldAsInt

public int getFieldAsInt(Field field)
Gets the value of the specified Field as an int. Note that numbers are converted in the search server to a float; getFieldAsInt will then convert the float to an int.

Parameters:
field - Field to evaluate
Returns:
int value of field
Throws:
java.lang.ClassCastException - if the value of the field is not of type int or the value is null. Use getFieldAsObject() to check if the value is null.
java.lang.IllegalArgumentException - if the field is not present in this ISearchResult

getFieldAsFloat

public float getFieldAsFloat(Field field)
Gets the value of the specified Field as a float. Note that numbers are converted in the search server to a float; specifically, properties stored as double in the portal are rounded to a float.

Parameters:
field - Field to evaluate
Returns:
float value of field
Throws:
java.lang.IllegalArgumentException - if the field is not present in this ISearchResult
java.lang.ClassCastException - if the value of the field is not of type float or the value is null. Use getFieldAsObject() to check if the value is null.

getFieldAsDate

public java.util.Date getFieldAsDate(Field field)
Gets the value of the specified Field as a Date. Note that Dates in the search server are only accurate to four minutes, as the double used to store dates in the portal is converted to float.

Parameters:
field - Field to evaluate
Returns:
Date value of field
Throws:
java.lang.IllegalArgumentException - if the field is not present in this ISearchResult
java.lang.ClassCastException - if the value of the field is not of type Date or the value is null. Use getFieldAsObject() to check if the value is null.

getFieldAsObject

public java.lang.Object getFieldAsObject(Field field)
Gets the value of the specified Field as an Object.

Parameters:
field - Field to evaluate
Returns:
Object value of field
Throws:
java.lang.IllegalArgumentException - if the field is not present in this ISearchResult


For additional information on the IDK, including tutorials, blogs, code samples and more,see the AquaLogic User Interaction Developer Center on BEA dev2dev.

Copyright ©2007 BEA Systems, Inc. All Rights Reserved.