lumis.search
Class SearchContent

Package class diagram package SearchContent
java.lang.Object
  extended by lumis.search.SearchContent
All Implemented Interfaces:
Serializable, Cloneable, IAttributeSetReader

@StableMinor(version="5.5",
             sinceVersion="4.0")
public class SearchContent
extends Object
implements IAttributeSetReader, Cloneable, Serializable

Unit of searchable information, containing one or more SearchContentField objects. This object is used to index searchable information by a search engine.

This object contains a collection of SearchContentField objects, which can contain more than one SearchContentField object with the same name value.

Since:
4.0.4
See Also:
Serialized Form

Constructor Summary
SearchContent()
          Constructs an empty instance of SearchContent.
SearchContent(SearchContent searchContent)
          Constructs an instance of SearchContent cloning the SearchContentFields of another SearchContent object.
 
Method Summary
 void addAttachment(SearchContentAttachment attachment)
          Adds an attachment to this search content.
 void addField(SearchContentField field)
          Adds a SearchContentField to the field collection.
 void clear()
          Removes all fields.
 SearchContent clone()
           
 List<SearchContentField> getAllFields()
          Returns a collection of all fields.
 Collection<SearchContentAttachment> getAttachments()
          Returns the attachments in this search content.
 List<String> getAttributeValues(String attributeName)
          Returns all the values related to the attribute named as specified.
 List<SearchContentField> getFields(String fieldName)
          Returns a collection of fields with the given name.
 List<String> getFieldValues(String fieldName)
          Returns the values of all fields with the given name.
 String getIdFieldValue()
          Returns the value of the identifier field.
 String getSubtitleFieldValue()
          Returns the value of the subtitle field.
 String getTextFieldValue()
          Returns the value of the text field.
 String getTitleFieldValue()
          Returns the value of the title field.
 String getUrlFieldValue()
          Returns the value of the URL field.
 boolean hasAttribute(String attributeName)
          Checks if the attribute set contains at least one attribute with the specified name.
 boolean hasField(String fieldName)
          Checks if there is at least one SearchContentField object in the field collection with the provided name.
 boolean hasIdField()
          Checks if there is, in the field collection, at least one identifier field.
 boolean hasSubtitleField()
          Checks if there is, in the field collection, at least one subtitle field.
 boolean hasTextField()
          Checks if there is, in the field collection, at least one text field.
 boolean hasTitleField()
          Checks if there is, in the field collection, at least one title field.
 boolean hasUrlField()
          Checks if there is, in the field collection, at least one URL field.
 boolean isValid()
          Checks if the object has all the required fields: identifier, title, subtitle and URL.
 void removeAttachment(SearchContentAttachment attachment)
          Removes an attachment from this search content.
 void removeFields(String fieldName)
          Removes all fields with the given name.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchContent

public SearchContent()
Constructs an empty instance of SearchContent.

Since:
4.0.4

SearchContent

public SearchContent(SearchContent searchContent)
Constructs an instance of SearchContent cloning the SearchContentFields of another SearchContent object.

Parameters:
searchContent -
Since:
4.0.4
Method Detail

addField

public void addField(SearchContentField field)
Adds a SearchContentField to the field collection.

Parameters:
field -
Since:
4.0.4

hasField

public boolean hasField(String fieldName)
Checks if there is at least one SearchContentField object in the field collection with the provided name.

Parameters:
fieldName - field name to be checked
Returns:
true, if there is at least one field with the provided name in the collection
Since:
4.0.4

hasIdField

public boolean hasIdField()
Checks if there is, in the field collection, at least one identifier field.

Returns:
true, if there is at least one identifier field in the field collection.
Since:
4.0.4

hasTitleField

public boolean hasTitleField()
Checks if there is, in the field collection, at least one title field.

Returns:
true, if there is at least one title field in the field collection.
Since:
4.0.4

hasSubtitleField

public boolean hasSubtitleField()
Checks if there is, in the field collection, at least one subtitle field.

Returns:
true, if there is at least one subtitle field in the field collection.
Since:
4.0.4

hasUrlField

public boolean hasUrlField()
Checks if there is, in the field collection, at least one URL field.

Returns:
true, if there is at least one URL field in the field collection.
Since:
4.0.4

hasTextField

public boolean hasTextField()
Checks if there is, in the field collection, at least one text field.

Returns:
true, if there is at least one text field in the field collection.
Since:
4.0.4

removeFields

public void removeFields(String fieldName)
Removes all fields with the given name.

Parameters:
fieldName - name of the fields to be removed.
Since:
4.0.4

clear

public void clear()
Removes all fields.

Since:
4.0.4

getFields

public List<SearchContentField> getFields(String fieldName)
Returns a collection of fields with the given name.

Parameters:
fieldName - field name
Returns:
collection of fields with the given name
Since:
4.0.4

getAllFields

public List<SearchContentField> getAllFields()
Returns a collection of all fields.

Returns:
collection of all fields.
Since:
4.0.4

getFieldValues

public List<String> getFieldValues(String fieldName)
Returns the values of all fields with the given name.

Parameters:
fieldName - field name
Returns:
values of all fields with the given name, or an empty List, if there no value to return.
Since:
4.0.4

getIdFieldValue

public String getIdFieldValue()
Returns the value of the identifier field.

Returns:
value of the identifier field, or null if there is no such field.
Since:
4.0.4
See Also:
SearchContentField, SearchContentField.FIELDNAME_ID

getTitleFieldValue

public String getTitleFieldValue()
Returns the value of the title field.

Returns:
value of the title field, or null if there is no such field.
Since:
4.0.4
See Also:
SearchContentField, SearchContentField.FIELDNAME_TITLE

getSubtitleFieldValue

public String getSubtitleFieldValue()
Returns the value of the subtitle field.

Returns:
value of the subtitle field, or null if there is no such field.
Since:
4.0.4
See Also:
SearchContentField, SearchContentField.FIELDNAME_SUBTITLE

getUrlFieldValue

public String getUrlFieldValue()
Returns the value of the URL field.

Returns:
value of the URL field, or null if there is no such field.
Since:
4.0.4
See Also:
SearchContentField, SearchContentField.FIELDNAME_URL

getTextFieldValue

public String getTextFieldValue()
Returns the value of the text field.

Returns:
value of the text field, or null if there is no such field.
Since:
4.0.4
See Also:
SearchContentField, SearchContentField.FIELDNAME_TEXT

isValid

public boolean isValid()
Checks if the object has all the required fields: identifier, title, subtitle and URL.

Returns:
true if all the required fields exit.
Since:
4.0.4

getAttributeValues

public List<String> getAttributeValues(String attributeName)
Description copied from interface: IAttributeSetReader
Returns all the values related to the attribute named as specified.

Specified by:
getAttributeValues in interface IAttributeSetReader
Parameters:
attributeName - name of the attribute.
Returns:
all values related to the specified attribute name, or an empty List if there is no value to return.

hasAttribute

public boolean hasAttribute(String attributeName)
Description copied from interface: IAttributeSetReader
Checks if the attribute set contains at least one attribute with the specified name.

Specified by:
hasAttribute in interface IAttributeSetReader
Parameters:
attributeName - name of the attribute.
Returns:
true if at least one attribute with the provided name was found.

clone

public SearchContent clone()
                    throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getAttachments

public Collection<SearchContentAttachment> getAttachments()
Returns the attachments in this search content.

Returns:
a immutable collection containing the attachments.
Since:
4.2.2

addAttachment

public void addAttachment(SearchContentAttachment attachment)
Adds an attachment to this search content.

Parameters:
attachment - the attachment.
Since:
4.2.2

removeAttachment

public void removeAttachment(SearchContentAttachment attachment)
Removes an attachment from this search content.

Parameters:
attachment - the attachment to remove.
Since:
4.2.2


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.