Class BaseSearchInputDocument
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.searchengine.base.BaseSearchInputDocument
-
- All Implemented Interfaces:
SearchInputDocument
public class BaseSearchInputDocument extends Object implements SearchInputDocument
A foundation class for implementing SearchInputDocument.
-
-
Constructor Summary
Constructors Constructor Description BaseSearchInputDocument()Default constructor.BaseSearchInputDocument(BaseSearchInputDocument doc)Create a deep copy, down to the value objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddField(SearchInputField field)Put the field into the document.voidaddField(String name, float boost, Object... values)Create a field with this name, boost level and values, and put it into the document.voidaddField(String name, float boost, Collection<Object> values)Create a field with this name, boost level and values, and put it into the document.voidaddField(String name, Object... values)Create a field with this name and values, and put it into the document.voidaddField(String name, Collection<Object> values)Create a field with this name and values, and put it into the document.SearchInputFieldcreateField(String name)Sub-classes should override this if the field requires special functionality.booleanequals(Object obj)floatgetDocumentBoost()SearchInputFieldgetField(String name)May return null.Map<String,SearchInputField>getFieldMap()May return an empty map, but never null.inthashCode()voidsetDocumentBoost(float searchBoost)Set a boost level for the document as a whole.StringtoString()
-
-
-
Constructor Detail
-
BaseSearchInputDocument
public BaseSearchInputDocument()
Default constructor.
-
BaseSearchInputDocument
public BaseSearchInputDocument(BaseSearchInputDocument doc)
Create a deep copy, down to the value objects.
-
-
Method Detail
-
addField
public void addField(SearchInputField field)
Description copied from interface:SearchInputDocumentPut the field into the document. If a field with this name already exists in the document, it will be replaced.- Specified by:
addFieldin interfaceSearchInputDocument
-
addField
public void addField(String name, Object... values)
Description copied from interface:SearchInputDocumentCreate a field with this name and values, and put it into the document. If a field with this name already exists in the document, these values will be added to the existing values on the field.- Specified by:
addFieldin interfaceSearchInputDocument
-
addField
public void addField(String name, Collection<Object> values)
Description copied from interface:SearchInputDocumentCreate a field with this name and values, and put it into the document. If a field with this name already exists in the document, these values will be added to the existing values on the field.- Specified by:
addFieldin interfaceSearchInputDocument
-
addField
public void addField(String name, float boost, Object... values)
Description copied from interface:SearchInputDocumentCreate a field with this name, boost level and values, and put it into the document. If a field with this name already exists in the document, these values will be added to the existing values on the field, and the existing boost will be multipled by this boost.- Specified by:
addFieldin interfaceSearchInputDocument
-
addField
public void addField(String name, float boost, Collection<Object> values)
Description copied from interface:SearchInputDocumentCreate a field with this name, boost level and values, and put it into the document. If a field with this name already exists in the document, these values will be added to the existing values on the field, and the existing boost will be multipled by this boost.- Specified by:
addFieldin interfaceSearchInputDocument
-
setDocumentBoost
public void setDocumentBoost(float searchBoost)
Description copied from interface:SearchInputDocumentSet a boost level for the document as a whole.- Specified by:
setDocumentBoostin interfaceSearchInputDocument
-
getDocumentBoost
public float getDocumentBoost()
- Specified by:
getDocumentBoostin interfaceSearchInputDocument
-
getField
public SearchInputField getField(String name)
Description copied from interface:SearchInputDocumentMay return null.- Specified by:
getFieldin interfaceSearchInputDocument
-
getFieldMap
public Map<String,SearchInputField> getFieldMap()
Description copied from interface:SearchInputDocumentMay return an empty map, but never null.- Specified by:
getFieldMapin interfaceSearchInputDocument
-
createField
public SearchInputField createField(String name)
Sub-classes should override this if the field requires special functionality.- Specified by:
createFieldin interfaceSearchInputDocument
-
-